import type { Provider } from "@/types"; import { fmt } from "@/lib/format"; /** * Claims tab content for the ProviderDrawer (SP21 Task 3.1). * * Reads `provider.recent_claims` — the top-10 claims joined to this * provider from the extended `GET /api/config/providers/{npi}` endpoint * (Task 1.6). Renders one row per claim (`id` + `patientName` + * `billedAmount`) with a "View all claims →" link to the global claims * page at the bottom. Falls back to an empty-state line when the * provider has no recent claims (e.g. legacy callers that hit the * detail endpoint without the recent-claims slice). */ export function ProviderRecentClaims({ provider }: { provider: Provider }) { const claims = provider.recent_claims ?? []; if (claims.length === 0) { return (
No recent claims.
); } return (
{claims.map((c) => (
{c.id}
{c.patientName ?? "—"}
{fmt.usd(c.billedAmount)}
))} View all claims →
); }