feat(home): הסרת כרטיס "תיקים לפי סטטוס" — דונאט-הסטטוס לבדו (#1) #274
@@ -9,7 +9,7 @@ import { AppealTypeBars, subtypeOf } from "@/components/cases/appeal-type-bars";
|
||||
import { CasesTable } from "@/components/cases/cases-table";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useCases, type Case, type CaseStatus } from "@/lib/api/cases";
|
||||
import { useCases, type Case } from "@/lib/api/cases";
|
||||
import {
|
||||
usePendingApprovals,
|
||||
type ApprovalSeverity,
|
||||
@@ -23,17 +23,6 @@ const SEVERITY_DOT: Record<ApprovalSeverity, string> = {
|
||||
ok: "bg-success",
|
||||
};
|
||||
|
||||
// "תיקים לפי סטטוס" horizontal status bars (mockup 04: .bar / .track / .fill).
|
||||
// Driven by the same live cases the KPI row uses — five status groups onto the
|
||||
// gold/info/success/danger/muted palette.
|
||||
type StatusBarRow = { label: string; fill: string; match: CaseStatus[] };
|
||||
const STATUS_BARS: StatusBarRow[] = [
|
||||
{ label: "בהכנה", fill: "bg-info", match: ["new", "uploading", "processing", "documents_ready", "analyst_verified", "research_complete", "outcome_set"] },
|
||||
{ label: "ניתוח וכיוון", fill: "bg-gold", match: ["brainstorming", "direction_approved", "analysis_enriched", "ready_for_writing"] },
|
||||
{ label: "בכתיבה", fill: "bg-warn", match: ["drafting", "qa_review", "drafted"] },
|
||||
{ label: "הושלם", fill: "bg-success", match: ["exported", "reviewed", "final"] },
|
||||
];
|
||||
|
||||
export default function HomePage() {
|
||||
const { data, isPending, error } = useCases(true);
|
||||
// INV-IA1 pointer: surface the single approvals aggregate on the dashboard,
|
||||
@@ -52,16 +41,6 @@ export default function HomePage() {
|
||||
return { permits, levies };
|
||||
}, [data]);
|
||||
|
||||
const statusBars = useMemo(() => {
|
||||
const cases = data ?? [];
|
||||
const counts = STATUS_BARS.map((b) => ({
|
||||
...b,
|
||||
n: cases.filter((c) => b.match.includes(c.status)).length,
|
||||
}));
|
||||
const max = Math.max(1, ...counts.map((c) => c.n));
|
||||
return { counts, max };
|
||||
}, [data]);
|
||||
|
||||
return (
|
||||
<AppShell>
|
||||
<section className="space-y-7">
|
||||
@@ -93,31 +72,8 @@ export default function HomePage() {
|
||||
{/* two-column body — main flow + narrow gold gate rail (mockup 04 .cols) */}
|
||||
<div className="grid gap-6 lg:grid-cols-[1fr_360px]">
|
||||
<div className="space-y-6 min-w-0">
|
||||
{/* תיקים לפי סטטוס — horizontal bars (mockup 04) */}
|
||||
<Card className="bg-surface border-rule shadow-sm">
|
||||
<CardContent className="px-6 py-5">
|
||||
<h2 className="text-navy text-lg mb-4">תיקים לפי סטטוס</h2>
|
||||
<ul className="space-y-3">
|
||||
{statusBars.counts.map((b) => (
|
||||
<li key={b.label} className="flex items-center gap-3">
|
||||
<span className="w-20 shrink-0 text-[0.82rem] text-ink-soft">
|
||||
{b.label}
|
||||
</span>
|
||||
<span className="flex-1 h-3.5 rounded-full bg-rule-soft overflow-hidden">
|
||||
<span
|
||||
className={`block h-full rounded-full ${b.fill} transition-[width] duration-500`}
|
||||
style={{ width: `${(b.n / statusBars.max) * 100}%` }}
|
||||
/>
|
||||
</span>
|
||||
<span className="w-9 shrink-0 text-end text-[0.82rem] font-semibold text-navy tabular-nums">
|
||||
{isPending ? "—" : b.n}
|
||||
</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* "תיקים לפי סטטוס" (פסים אופקיים) הוסר — פיזור-הסטטוסים מוצג
|
||||
בדונאט "פיזור סטטוסים" בטור-הצד (#1). */}
|
||||
{/* live case tables kept in full (richer than the mockup's single feed) */}
|
||||
<Card className="bg-surface border-rule shadow-sm">
|
||||
<CardContent className="px-6 py-5">
|
||||
|
||||
Reference in New Issue
Block a user