Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
16ad896d19
commit
86cd472bc1
@@ -278,11 +278,65 @@ function CasesList() {
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
{selected.size > 0 && (
|
||||
<div className="mb-3 flex flex-wrap items-center gap-2 rounded-md border border-border/60 bg-muted/30 px-3 py-2">
|
||||
<span className="text-sm font-medium">{selected.size} selected</span>
|
||||
<Button size="sm" variant="outline" onClick={() => setSelected(new Set())} disabled={busy}>
|
||||
Clear
|
||||
</Button>
|
||||
<div className="mx-2 h-5 w-px bg-border" />
|
||||
{view === "active" ? (
|
||||
<Button size="sm" variant="outline" onClick={() => bulkArchive(true)} disabled={busy}>
|
||||
<Archive className="h-4 w-4 mr-2" /> Archive
|
||||
</Button>
|
||||
) : (
|
||||
<Button size="sm" variant="outline" onClick={() => bulkArchive(false)} disabled={busy}>
|
||||
<ArchiveRestore className="h-4 w-4 mr-2" /> Restore
|
||||
</Button>
|
||||
)}
|
||||
<div className="mx-2 h-5 w-px bg-border" />
|
||||
<span className="text-sm text-muted-foreground">Attorney:</span>
|
||||
<div className="w-[200px]">
|
||||
<SearchableSelect
|
||||
value={assignAttorney}
|
||||
onValueChange={setAssignAttorney}
|
||||
options={userOptions}
|
||||
placeholder="Select user…"
|
||||
searchPlaceholder="Search users…"
|
||||
/>
|
||||
</div>
|
||||
<Button size="sm" onClick={bulkAssignAttorney} disabled={busy || !assignAttorney}>
|
||||
Apply
|
||||
</Button>
|
||||
<div className="mx-2 h-5 w-px bg-border" />
|
||||
<span className="text-sm text-muted-foreground">Client:</span>
|
||||
<div className="w-[200px]">
|
||||
<SearchableSelect
|
||||
value={assignClient}
|
||||
onValueChange={setAssignClient}
|
||||
options={clientOptions}
|
||||
placeholder="Select client…"
|
||||
searchPlaceholder="Search clients…"
|
||||
/>
|
||||
</div>
|
||||
<Button size="sm" onClick={bulkAssignClient} disabled={busy || !assignClient}>
|
||||
Apply
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<Card className="border-border/60 overflow-hidden">
|
||||
<CardContent className="p-0">
|
||||
<table className="w-full text-sm">
|
||||
<thead className="bg-muted/50 text-xs uppercase tracking-wider text-muted-foreground">
|
||||
<tr>
|
||||
<th className="px-4 py-3 w-10">
|
||||
<Checkbox
|
||||
checked={allSelected ? true : someSelected ? "indeterminate" : false}
|
||||
onCheckedChange={toggleAll}
|
||||
aria-label="Select all"
|
||||
/>
|
||||
</th>
|
||||
<SortHeader label="Case" k="title" />
|
||||
<SortHeader label="Client" k="client" />
|
||||
<SortHeader label="Status" k="status" />
|
||||
@@ -294,7 +348,7 @@ function CasesList() {
|
||||
</thead>
|
||||
<tbody>
|
||||
{sorted.length === 0 && (
|
||||
<tr><td colSpan={7} className="text-center py-12 text-muted-foreground">
|
||||
<tr><td colSpan={8} className="text-center py-12 text-muted-foreground">
|
||||
{view === "archived" ? "No archived cases." : "No cases."}
|
||||
</td></tr>
|
||||
)}
|
||||
@@ -304,6 +358,13 @@ function CasesList() {
|
||||
className="border-t hover:bg-muted/30 cursor-pointer transition-colors"
|
||||
onClick={() => navigate({ to: "/cases/$caseId", params: { caseId: c.id } })}
|
||||
>
|
||||
<td className="px-4 py-3" onClick={(e) => e.stopPropagation()}>
|
||||
<Checkbox
|
||||
checked={selected.has(c.id)}
|
||||
onCheckedChange={() => toggleOne(c.id)}
|
||||
aria-label={`Select ${c.title}`}
|
||||
/>
|
||||
</td>
|
||||
<td className="px-4 py-3">
|
||||
<Link
|
||||
to="/cases/$caseId"
|
||||
|
||||
Reference in New Issue
Block a user