import { Link } from "react-router-dom"; import { Skeleton } from "@/components/ui/skeleton"; import { fmt } from "@/lib/format"; import { usePayerSummary } from "@/hooks/usePayerSummary"; import type { PayerSummary } from "@/lib/api"; interface Props { payerId: string; } /** * Peek body for a payer — aggregate stats card shown inside the * centered PeekModal (SP21 universal drill-down). * * Owns its own fetch via `usePayerSummary`; the parent PeekModal only * concerns itself with open/close + title. We deliberately do NOT show * an error state here — the peek is a low-stakes summary, so a silent * retry + skeleton on failure is acceptable (the parent modal still * closes correctly). * * `fmt.pct` does not multiply by 100 (it's just `n.toFixed(d)%`), so the * API's fraction `denial_rate` (0–1) needs `* 100` before formatting — * otherwise the UI would render "0.0%" for everything. */ export function PayerPeekContent({ payerId }: Props) { const { data, isLoading } = usePayerSummary(payerId); if (isLoading || !data) { return (