diff --git a/client/components/data/dataShared.jsx b/client/components/data/dataShared.jsx index 142a2ef..de0644b 100644 --- a/client/components/data/dataShared.jsx +++ b/client/components/data/dataShared.jsx @@ -1,6 +1,14 @@ import React, { useEffect, useState } from 'react'; import { cn } from '@/lib/utils'; -import { ChevronDown, ChevronRight } from 'lucide-react'; +import { ChevronDown } from 'lucide-react'; + +// At-a-glance health tones for the optional SectionCard status dot. +const DOT_TONES = { + green: 'bg-emerald-500', + amber: 'bg-amber-500', + red: 'bg-rose-500', + gray: 'bg-muted-foreground/40', +}; export function fmt(isoStr) { if (!isoStr) return '—'; @@ -23,6 +31,9 @@ export function importErrorState(err, fallback) { export function SectionCard({ title, subtitle, + icon: Icon, // optional lucide icon component, shown in a soft chip + statusDot, // optional 'green' | 'amber' | 'red' | 'gray' health dot + badge, // optional node rendered next to the title (e.g. a count pill) children, className, collapsible = false, @@ -44,35 +55,44 @@ export function SectionCard({ const headerContent = ( <> - {collapsible && ( - open - ? - : + {Icon && ( + + + )}
-

{title}

- {subtitle &&

{subtitle}

} +
+ {statusDot && } +

{title}

+ {badge} +
+ {subtitle &&

{subtitle}

} {collapsible && !open && summary && (

{summary}

)}
{actions &&
{actions}
} + {collapsible && ( + + )} ); return ( -
+
{collapsible ? ( ) : ( -
+
{headerContent}
)}