Scenario failed
diff --git a/packages/web/components/KpiCard.tsx b/packages/web/components/KpiCard.tsx
index a797197..133eb38 100644
--- a/packages/web/components/KpiCard.tsx
+++ b/packages/web/components/KpiCard.tsx
@@ -3,12 +3,14 @@ interface KpiCardProps {
value: string | null;
unit?: string;
highlight?: boolean;
+ onClick?: () => void;
}
-export function KpiCard({ label, value, unit, highlight }: KpiCardProps) {
+export function KpiCard({ label, value, unit, highlight, onClick }: KpiCardProps) {
return (
{label}
diff --git a/packages/web/components/WorkbookView.tsx b/packages/web/components/WorkbookView.tsx
index 10f237d..7ec58f3 100644
--- a/packages/web/components/WorkbookView.tsx
+++ b/packages/web/components/WorkbookView.tsx
@@ -298,7 +298,7 @@ function buildDebtRows(debt: DebtYearRow[]): TableRow[] {
// Sheet views
// ---------------------------------------------------------------------------
-function SummarySheet({ kpis, scenarioId }: { kpis: KpiSummary; scenarioId: string }) {
+function SummarySheet({ kpis, scenarioId, onNavigate }: { kpis: KpiSummary; scenarioId: string; onNavigate?: (sheet: string) => void }) {
const { data: stmts } = useQuery({
queryKey: ["statements", scenarioId],
queryFn: () => getStatements(scenarioId),
@@ -364,25 +364,72 @@ function SummarySheet({ kpis, scenarioId }: { kpis: KpiSummary; scenarioId: stri
value={kpis.solved_tariff_inr_per_kwh != null ? kpis.solved_tariff_inr_per_kwh.toFixed(2) : null}
unit="₹/kWh"
highlight
+ onClick={() => onNavigate?.("generation")}
/>
onNavigate?.("irr")}
+ />
+ onNavigate?.("irr")}
+ />
+ onNavigate?.("debt")}
+ />
+ onNavigate?.("debt")}
+ />
+ onNavigate?.("debt")}
+ />
+ onNavigate?.("debt")}
+ />
+ onNavigate?.("idc")}
+ />
+ onNavigate?.("irr")}
+ />
+ onNavigate?.("irr")}
/>
-
-
-
-
-
-
-
-
{kpis.solar_y1_cuf != null && (
-
+ onNavigate?.("generation")}
+ />
)}
{kpis.wind_y1_plf != null && (
-
+ onNavigate?.("generation")}
+ />
)}
{kpis.rtc_cuf_achieved != null && (
@@ -997,9 +1044,10 @@ interface Props {
codYear?: number;
solarDCMW?: number;
windMW?: number;
+ onNavigate?: (sheet: string) => void;
}
-export function WorkbookView({ scenarioId, kpis, debtScheduleJson, activeSheet, codYear, solarDCMW, windMW }: Props) {
+export function WorkbookView({ scenarioId, kpis, debtScheduleJson, activeSheet, codYear, solarDCMW, windMW, onNavigate }: Props) {
const { data: stmts } = useQuery({
queryKey: ["statements", scenarioId],
queryFn: () => getStatements(scenarioId),
@@ -1032,7 +1080,7 @@ export function WorkbookView({ scenarioId, kpis, debtScheduleJson, activeSheet,
All monetary values in INR Crore unless noted
- {activeSheet === "summary" && }
+ {activeSheet === "summary" && }
{activeSheet === "pnl" && pnl.length > 0 && (
)}