diff --git a/src/features/launcher/AccountGrid.tsx b/src/features/launcher/AccountGrid.tsx index dc77813..2764b00 100644 --- a/src/features/launcher/AccountGrid.tsx +++ b/src/features/launcher/AccountGrid.tsx @@ -19,6 +19,7 @@ export function AccountGrid({ selectedAccountId, onSelectAccount }: AccountGridP const { data: accounts, isLoading } = useGameAccounts(); const refreshAccounts = useRefreshAccounts(); const [contextMenu, setContextMenu] = useState(null); + const [copiedId, setCopiedId] = useState(null); const handleContextMenu = useCallback((e: React.MouseEvent, accountId: string) => { e.preventDefault(); @@ -27,6 +28,13 @@ export function AccountGrid({ selectedAccountId, onSelectAccount }: AccountGridP const closeContextMenu = useCallback(() => setContextMenu(null), []); + function handleCopyAccount(e: React.MouseEvent, accountId: string) { + e.stopPropagation(); + navigator.clipboard.writeText(accountId); + setCopiedId(accountId); + setTimeout(() => setCopiedId(null), 1500); + } + return (
@@ -46,17 +54,59 @@ export function AccountGrid({ selectedAccountId, onSelectAccount }: AccountGridP {accounts.map((account) => { const isSelected = selectedAccountId === account.id; const initial = account.displayName.charAt(0).toUpperCase(); + const isCopied = copiedId === account.id; return (