import { useQuery } from '@tanstack/react-query' import { Siren, TrendingDown } from 'lucide-react' import { get } from '../../lib/api' import type { ApexDigest } from '../../lib/api' import { Card, Empty, StatusPill } from '../../components/ui/bits' import { demoDigest } from '../../lib/demo/apex' /** * Where the refinanced portfolio is deteriorating — as districts, sectors and * partner banks, never as borrowers. * *
Ranked by the count of stressed enterprises rather than by rate. A 40%
* stress rate over eight borrowers is noise; a 12% rate over three hundred is a
* programme. Both numbers are shown, but the ordering says which to read first.
*/
export function DigestPage() {
const { data, isError } = useQuery({ queryKey: ['apex-digest'], queryFn: () => get
As at {d.asOf} · ranked by how many enterprises are affected, not by rate
An alert nobody acts on is the failure this tier is uniquely placed to catch — the
borrower's own bank has every reason not to report it, and the borrower cannot.
Early warning
{d.districtsUnderStress.map((c) => (
)}
{d.sectorsUnderStress.map((c) => (
)}
)}
{d.slowestResponders.map((b) => (
Institution
Alerts raised
Acted on
Response rate
))}
{b.shortName}
{b.alertsRaised}
{b.alertsActioned}
{b.responseRatePct}%