import React from 'react'; import { cn } from '@/lib/utils'; import { Button } from '@/components/ui/button'; import { RefreshCw } from 'lucide-react'; export function fmt(isoStr) { if (!isoStr) return '—'; const d = new Date(isoStr); return d.toLocaleDateString(undefined, { month: 'short', day: 'numeric', year: 'numeric' }) + ' ' + d.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }); } export function importErrorState(err, fallback) { const data = err?.data || {}; return { message: err?.message || data.message || data.error || fallback, error: data.error || fallback, code: data.code || err?.code || null, details: Array.isArray(data.details) ? data.details : (Array.isArray(err?.details) ? err.details : []), error_id: data.error_id || null, }; } export function SectionCard({ title, subtitle, children, className }) { return (

{title}

{subtitle &&

{subtitle}

}
{children}
); } export function CountPill({ label, value }) { return (

{label}

{value ?? 0}

); }