diff --git a/apps/client-ts/src/app/(Dashboard)/b2c/profile/page.tsx b/apps/client-ts/src/app/(Dashboard)/b2c/profile/page.tsx index 6bfd9fd9b..e902452a0 100644 --- a/apps/client-ts/src/app/(Dashboard)/b2c/profile/page.tsx +++ b/apps/client-ts/src/app/(Dashboard)/b2c/profile/page.tsx @@ -15,15 +15,27 @@ import Cookies from 'js-cookie'; import useProfileStore from "@/state/profileStore"; import useProjectStore from "@/state/projectStore" import { useQueryClient } from '@tanstack/react-query'; +import { useState } from "react"; const Profile = () => { + const [copied, setCopied] = useState(false); const { profile, setProfile } = useProfileStore(); const { setIdProject } = useProjectStore(); const queryClient = useQueryClient(); const router = useRouter(); + const handleCopy = async (email: string) => { + try { + await navigator.clipboard.writeText(email) + setCopied(true); + setTimeout(() => setCopied(false), 2000); // Reset copied state after 2 seconds + } catch (err) { + console.error('Failed to copy: ', err); + } + }; + const onLogout = () => { router.push('/b2c/login') Cookies.remove("access_token") @@ -33,7 +45,7 @@ const Profile = () => { } return ( -