import { Card, KpiTile } from '../../components/ui/bits' import { ForecastFan } from '../../components/charts/ForecastFan' import { BandMigrationBar } from '../../components/charts/BandMigrationBar' import { bandMigration, portfolioForecast, sectorRollup } from '../../lib/demo/ops' import { inrCompact } from '../../lib/demo/seed' import { useScope } from './officerScope' /** * Portfolio-level view of the same forecast the enterprise pages show one at a * time: the h = 1…6 aggregate, how each sector pack is carrying risk, and how * the book migrated between watchlist bands over the last six months. */ export function ForecastsPage() { const { block } = useScope() const aggregate = portfolioForecast(block) const sectors = sectorRollup(block) const migration = bandMigration(block) const worst = aggregate.reduce((a, p) => (p.p10 - p.obligation < a.p10 - a.obligation ? p : a), aggregate[0]) const covered = aggregate.filter((p) => p.p10 >= p.obligation).length return (
| Sector pack | Enterprises | High risk | Watch | Standard | Avg score | Mix |
|---|---|---|---|---|---|---|
| {s.label} | {s.count} | {s.red} | {s.watch} | {s.standard} | {s.avgScore} |