Skip to content

Commit 3d2c374

Browse files
add an easy way to see org id during the get approved screen (#1507)
Co-authored-by: chasprowebdev <chasgarciaprowebdev@gmail.com>
1 parent 2eb92d3 commit 3d2c374

1 file changed

Lines changed: 54 additions & 2 deletions

File tree

apps/app/src/app/(app)/upgrade/[orgId]/components/booking-step.tsx

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
'use client';
22

3+
import { useState } from 'react';
4+
import { ArrowRight, Check, Copy } from 'lucide-react';
5+
import { toast } from 'sonner';
6+
import Link from 'next/link';
37
import { Button } from '@comp/ui/button';
48
import { Card } from '@comp/ui/card';
5-
import { ArrowRight } from 'lucide-react';
6-
import Link from 'next/link';
9+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@comp/ui/tooltip';
710

811
export function BookingStep({
912
email,
@@ -20,6 +23,8 @@ export function BookingStep({
2023
complianceFrameworks: string[];
2124
hasAccess: boolean;
2225
}) {
26+
const [isCopied, setIsCopied] = useState(false);
27+
2328
const title = !hasAccess ? `Let's get ${company} approved` : 'Talk to us to upgrade';
2429

2530
const description = !hasAccess
@@ -28,6 +33,23 @@ export function BookingStep({
2833

2934
const cta = !hasAccess ? 'Book Your Demo' : 'Book a Call';
3035

36+
const handleCopyOrgId = async () => {
37+
if (isCopied) return;
38+
39+
try {
40+
await navigator.clipboard.writeText(orgId);
41+
setIsCopied(true);
42+
toast.success('Org ID copied to clipboard');
43+
44+
// Reset after 3 seconds
45+
setTimeout(() => {
46+
setIsCopied(false);
47+
}, 3000);
48+
} catch (error) {
49+
toast.error('Failed to copy Org ID');
50+
}
51+
};
52+
3153
return (
3254
<div className="flex justify-center w-full animate-in fade-in-50 duration-500">
3355
<Card className="w-full max-w-xl border border-gray-100 dark:border-gray-800 shadow-lg shadow-gray-200/30 dark:shadow-black/20 bg-card">
@@ -38,6 +60,36 @@ export function BookingStep({
3860
<p className="text-muted-foreground text-base max-w-xl mx-auto">{description}</p>
3961
</div>
4062

63+
{/* Org ID Display with Copy Button */}
64+
<div className="flex items-center justify-center mb-4">
65+
<span className="text-xs font-mono px-3 rounded-sm border bg-background border-input text-foreground select-all flex items-center h-9 border-r-0 rounded-tr-none rounded-br-none">
66+
Org ID: {orgId}
67+
</span>
68+
<TooltipProvider>
69+
<Tooltip>
70+
<TooltipTrigger asChild>
71+
<Button
72+
type="button"
73+
size="icon"
74+
variant="outline"
75+
className="text-xs rounded-tl-none rounded-bl-none"
76+
onClick={handleCopyOrgId}
77+
aria-label={isCopied ? "Copied!" : "Copy Org ID"}
78+
>
79+
{isCopied ? (
80+
<Check className="w-4 h-4 text-green-600 dark:text-green-400" />
81+
) : (
82+
<Copy className="w-4 h-4" />
83+
)}
84+
</Button>
85+
</TooltipTrigger>
86+
<TooltipContent>
87+
<p className="text-xs">{isCopied ? "Copied!" : "Copy Org ID"}</p>
88+
</TooltipContent>
89+
</Tooltip>
90+
</TooltipProvider>
91+
</div>
92+
4193
{/* CTA Button */}
4294
<div className="flex justify-center">
4395
<Link

0 commit comments

Comments
 (0)