/** * Contact Detail Page — loads a single contact by ID from route params. */ import React from 'react'; import { useParams, useNavigate } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { ContactDetail } from '@/components/contacts/ContactDetail'; import { ContactEditForm } from '@/components/contacts/ContactEditForm'; import { useWindowStore } from '@/store/windowStore'; import { useUnifiedContact, type UnifiedContact } from '@/api/hooks'; import { Button } from '@/components/ui/Button'; import { ChevronLeft } from 'lucide-react'; import { PrintButton } from '@/components/common/PrintButton'; export function ContactDetailPage() { const { t } = useTranslation(); const { id } = useParams<{ id: string }>(); const navigate = useNavigate(); const { data: contact, isLoading } = useUnifiedContact(id); const openWindow = useWindowStore((s) => s.openWindow); const handleEdit = () => { if (contact) { openWindow({ title: t('contacts.edit'), type: 'contact-edit', component: ContactEditForm, componentProps: { contact, onClose: () => {}, onSaved: () => {}, }, }); } }; const handleDeleted = () => { navigate('/contacts'); }; return (
); }