'use client'; import { useCallback, useState } from 'react'; import { useTranslations } from 'next-intl'; import { Copy } from 'lucide-react'; import { DialogCloseButton } from '@/components/ui/shared/DialogCloseButton'; import { ResponsiveDialogOverlay, ResponsiveDialogPanel, } from '@/components/ui/shared/ResponsiveDialog'; import { Button } from '@/components/ui/shared/Button'; import { useToast } from '@/lib/hooks/useToast'; import { LabCaseShareQrCode } from '@/components/ui/lab/LabCaseShareQrCode'; interface LabCaseShareQrDialogProps { open: boolean; onClose: () => void; shareUrl: string; } export function LabCaseShareQrDialog({ open, onClose, shareUrl }: LabCaseShareQrDialogProps) { const t = useTranslations('cases'); const { showSuccess } = useToast(); const [copying, setCopying] = useState(false); const handleCopy = useCallback(async () => { setCopying(true); try { await navigator.clipboard.writeText(shareUrl); showSuccess(t('shareLinkCopied')); } catch { // ignore clipboard failures } finally { setCopying(false); } }, [shareUrl, showSuccess, t]); if (!open) return null; return (

{t('shareQrDialogTitle')}

{t('shareQrDialogSubtitle')}

{shareUrl}

); } interface LabCaseShareQrThumbProps { shareUrl: string; onClick: () => void; } export function LabCaseShareQrThumb({ shareUrl, onClick }: LabCaseShareQrThumbProps) { const t = useTranslations('cases'); return ( ); }