Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-18 01:43:35 +00:00
co-authored by renee-png
parent 40f57cc2b7
commit e7a6ed5d53
3 changed files with 89 additions and 21 deletions
+21 -1
View File
@@ -9,13 +9,14 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { supabase } from "@/integrations/supabase/client";
import { ClientFormDialog } from "@/components/clients/client-form-dialog";
import { useAuth } from "@/lib/auth";
import { ArrowLeft, Edit, Plus, Building2, User, MapPin, Mail, Phone, Users, Activity, Briefcase, FileDown, Contact, Receipt } from "lucide-react";
import { ArrowLeft, Edit, Plus, Building2, User, MapPin, Mail, Phone, Users, Activity, Briefcase, FileDown, Contact, Receipt, Archive, ArchiveRestore } from "lucide-react";
import { ContactsLinkTab } from "@/components/contacts/contacts-link-tab";
import { formatCurrency, formatDate, formatDateTime, statusBadgeClass } from "@/lib/format";
import { toast } from "sonner";
import { downloadStatusReport } from "@/lib/status-pdf";
import { GenerateInvoiceDialog } from "@/components/invoices/generate-invoice-dialog";
import { TrustAccountPanel } from "@/components/trust/trust-account-panel";
import { setArchived } from "@/lib/archive";
export const Route = createFileRoute("/clients/$clientId")({
component: () => (
@@ -123,11 +124,30 @@ function ClientDetail() {
description={client.management_company || client.client_type.toUpperCase()}
actions={
<>
{client.archived_at && (
<Badge variant="outline" className="bg-muted text-muted-foreground">
<Archive className="h-3 w-3 mr-1" /> Archived
</Badge>
)}
{canEdit && (
<Button variant="outline" onClick={() => setEditOpen(true)}>
<Edit className="h-4 w-4 mr-2" /> Edit
</Button>
)}
{canEdit && (
<Button
variant="outline"
onClick={async () => {
if (await setArchived("clients", client.id, !client.archived_at)) load();
}}
>
{client.archived_at ? (
<><ArchiveRestore className="h-4 w-4 mr-2" /> Restore</>
) : (
<><Archive className="h-4 w-4 mr-2" /> Archive</>
)}
</Button>
)}
<Button variant="outline" onClick={() => setInvoiceOpen(true)}>
<Receipt className="h-4 w-4 mr-2" /> Generate invoice
</Button>