Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-20 00:16:05 +00:00
co-authored by renee-png
parent 6ba25749a2
commit a1e1d2f6d6
+35 -13
View File
@@ -341,20 +341,42 @@ function CollectionDetailRoute() {
return (
<ProtectedLayout>
<PageContainer>
<div className="flex items-center justify-between gap-2 mb-3">
<Button
variant="ghost"
size="sm"
onClick={() => navigate({ to: "/collections" })}
className="-ml-2"
>
<ArrowLeft className="h-4 w-4 mr-1" /> All collections
</Button>
{collection.case?.client?.id && (
<Button size="sm" onClick={() => navigate({ to: "/invoices/new/$clientId", params: { clientId: collection.case.client.id }, search: { caseId: collection.case.id } })}>
<FilePlus className="h-4 w-4 mr-1.5" /> Generate invoice
<div className="flex items-center justify-between gap-2 mb-3 flex-wrap">
<div className="flex items-center gap-2">
<Button
variant="ghost"
size="sm"
onClick={() => navigate({ to: "/collections" })}
className="-ml-2"
>
<ArrowLeft className="h-4 w-4 mr-1" /> All collections
</Button>
)}
{collection.status === "closed" && (
<Badge variant="outline" className="border-emerald-600 text-emerald-700">
Closed{collection.closed_at ? ` · ${formatDate(collection.closed_at)}` : ""}
</Badge>
)}
</div>
<div className="flex items-center gap-2 flex-wrap">
<Button size="sm" variant="outline" onClick={() => setApplyHoOpen(true)}>
<UserPlus className="h-4 w-4 mr-1.5" />
{collection.homeowner ? "Change homeowner" : "Apply homeowner"}
</Button>
{collection.status === "closed" ? (
<Button size="sm" variant="outline" onClick={reopenCollection} disabled={closingBusy}>
<Unlock className="h-4 w-4 mr-1.5" /> Reopen
</Button>
) : (
<Button size="sm" variant="outline" onClick={closeCollection} disabled={closingBusy}>
<Lock className="h-4 w-4 mr-1.5" /> Close collection
</Button>
)}
{collection.case?.client?.id && (
<Button size="sm" onClick={() => navigate({ to: "/invoices/new/$clientId", params: { clientId: collection.case.client.id }, search: { caseId: collection.case.id } })}>
<FilePlus className="h-4 w-4 mr-1.5" /> Generate invoice
</Button>
)}
</div>
</div>
{/* Tabs: Workflow (collections-specific) + same case tabs */}