diff --git a/apps/web/src/components/forms/public-profile.tsx b/apps/web/src/components/forms/public-profile.tsx index 9f6379cfa..4eb8946dd 100644 --- a/apps/web/src/components/forms/public-profile.tsx +++ b/apps/web/src/components/forms/public-profile.tsx @@ -3,6 +3,7 @@ import { useRouter } from 'next/navigation'; import { zodResolver } from '@hookform/resolvers/zod'; +import { Copy } from 'lucide-react'; import { useForm } from 'react-hook-form'; import { z } from 'zod'; @@ -98,13 +99,35 @@ export const PublicProfileForm = ({ className, user }: PublicProfileFormProps) = } }; + const handleCopyUrl = () => { + const profileUrl = `documenso.com/u/${user.url}`; + navigator.clipboard + .writeText(profileUrl) + .then(() => { + toast({ + title: 'URL Copied', + description: 'The profile URL has been copied to your clipboard.', + duration: 3000, + }); + }) + .catch((err) => { + console.error('Failed to copy: ', err); + toast({ + title: 'Error', + description: 'Failed to copy the URL to clipboard.', + variant: 'destructive', + duration: 3000, + }); + }); + }; + return (
-
+
- )} /> +
+ documenso.com/u/{user.url} + +