Added practice area column
X-Lovable-Edit-ID: edt-3c3d77d9-cdbd-4861-b5c5-44038cb0fb31 Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
@@ -19,7 +19,7 @@ import { BulkConvertToCollectionsDialog } from "@/components/cases/bulk-convert-
|
||||
import { formatDistanceToNow } from "date-fns";
|
||||
import { toast } from "sonner";
|
||||
|
||||
type SortKey = "title" | "client" | "status" | "attorney" | "opened_at" | "last_activity";
|
||||
type SortKey = "title" | "client" | "practice_area" | "status" | "attorney" | "opened_at" | "last_activity";
|
||||
type SortDir = "asc" | "desc";
|
||||
|
||||
export const Route = createFileRoute("/cases/")({
|
||||
@@ -129,6 +129,7 @@ function CasesList() {
|
||||
switch (sortKey) {
|
||||
case "title": return (c.title ?? "").toLowerCase();
|
||||
case "client": return (c.client?.name ?? "").toLowerCase();
|
||||
case "practice_area": return (c.practice_area ?? "").toLowerCase();
|
||||
case "status": return (c.status ?? "").toLowerCase();
|
||||
case "attorney": return (c.assignee?.full_name || c.assignee?.email || "").toLowerCase();
|
||||
case "opened_at": return c.opened_at ?? "";
|
||||
@@ -428,6 +429,7 @@ function CasesList() {
|
||||
</th>
|
||||
<SortHeader label="Case" k="title" />
|
||||
<SortHeader label="Client" k="client" />
|
||||
<SortHeader label="Practice area" k="practice_area" />
|
||||
<SortHeader label="Status" k="status" />
|
||||
<SortHeader label="Attorney" k="attorney" />
|
||||
<SortHeader label="Opened" k="opened_at" />
|
||||
@@ -437,7 +439,7 @@ function CasesList() {
|
||||
</thead>
|
||||
<tbody>
|
||||
{sorted.length === 0 && (
|
||||
<tr><td colSpan={8} className="text-center py-12 text-muted-foreground">
|
||||
<tr><td colSpan={9} className="text-center py-12 text-muted-foreground">
|
||||
{view === "archived" ? "No archived cases." : "No cases."}
|
||||
</td></tr>
|
||||
)}
|
||||
@@ -466,6 +468,13 @@ function CasesList() {
|
||||
<div className="text-xs text-muted-foreground">{c.case_number}</div>
|
||||
</td>
|
||||
<td className="px-4 py-3 text-muted-foreground">{c.client?.name ?? "—"}</td>
|
||||
<td className="px-4 py-3">
|
||||
{c.practice_area ? (
|
||||
<Badge variant="secondary" className="font-normal">{c.practice_area}</Badge>
|
||||
) : (
|
||||
<span className="text-muted-foreground">—</span>
|
||||
)}
|
||||
</td>
|
||||
<td className="px-4 py-3">
|
||||
<Badge variant="outline" className={statusBadgeClass(c.status)}>{c.status.replace("_", " ")}</Badge>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user