diff --git a/packages/web/src/app/[domain]/settings/components/inviteTableColumns.tsx b/packages/web/src/app/[domain]/settings/components/inviteTableColumns.tsx index 449fd0ad..6d6a64d5 100644 --- a/packages/web/src/app/[domain]/settings/components/inviteTableColumns.tsx +++ b/packages/web/src/app/[domain]/settings/components/inviteTableColumns.tsx @@ -4,7 +4,6 @@ import { Button } from "@/components/ui/button"; import { ColumnDef } from "@tanstack/react-table" import { resolveServerPath } from "@/app/api/(client)/client"; import { createPathWithQueryParams } from "@/lib/utils"; -import { useToast } from "@/components/hooks/use-toast"; export type InviteColumnInfo = { id: string; @@ -39,9 +38,13 @@ export const inviteTableColumns = (displayToast: (message: string) => void): Col onClick={() => { const basePath = `${window.location.origin}${resolveServerPath('/')}`; const url = createPathWithQueryParams(`${basePath}redeem?invite_id=${invite.id}`); - navigator.clipboard.writeText(url); - - displayToast("✅ Copied invite link"); + navigator.clipboard.writeText(url) + .then(() => { + displayToast("✅ Copied invite link"); + }) + .catch(() => { + displayToast("❌ Failed to copy invite link"); + }) }} > +
+ {"Sourcebot + {"Sourcebot +
+
+

{title}

+
+ + ); +} + export default async function RedeemPage({ searchParams }: RedeemPageProps) { const invite_id = searchParams?.invite_id; @@ -28,25 +56,7 @@ export default async function RedeemPage({ searchParams }: RedeemPageProps) { if (!invite) { return ( -
-
- {"Sourcebot - {"Sourcebot -
-
-

This invite has either expired or was revoked. Contact your organization owner.

-
-
+ ); } @@ -61,25 +71,7 @@ export default async function RedeemPage({ searchParams }: RedeemPageProps) { if (user) { if (user.email !== invite.recipientEmail) { return ( -
-
- {"Sourcebot - {"Sourcebot -
-
-

This invite doesn't belong to you. You're currenly signed in with ${user.email}

-
-
+ ) } else { const org = await prisma.org.findUnique({ @@ -88,25 +80,7 @@ export default async function RedeemPage({ searchParams }: RedeemPageProps) { if (!org) { return ( -
-
- {"Sourcebot - {"Sourcebot -
-
-

This organization wasn't found. Please contact your organization owner.

-
-
+ ) } @@ -115,25 +89,7 @@ export default async function RedeemPage({ searchParams }: RedeemPageProps) { const subscription = await fetchSubscription(org.domain); if (isServiceError(subscription)) { return ( -
-
- {"Sourcebot - {"Sourcebot -
-
-

This organization's subscription has expired. Please renew the subscription and try again.

-
-
+ ) } }