From f1b1e85b53db87a04442181a40c530aca4791a14 Mon Sep 17 00:00:00 2001 From: Tyler Hoang Date: Mon, 29 Jun 2026 01:41:20 -0700 Subject: feat: add DCF panel components --- frontend/components/prism/DcfResults.tsx | 81 ++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 frontend/components/prism/DcfResults.tsx (limited to 'frontend/components/prism/DcfResults.tsx') diff --git a/frontend/components/prism/DcfResults.tsx b/frontend/components/prism/DcfResults.tsx new file mode 100644 index 0000000..062f041 --- /dev/null +++ b/frontend/components/prism/DcfResults.tsx @@ -0,0 +1,81 @@ +"use client"; + +import { fmtCurrency, fmtLarge, fmtPct } from "@/lib/format"; +import type { DcfComputed } from "@/lib/dcf"; +import type { DcfResult } from "@/types/api"; + +type Props = { + dcf: DcfResult; + computed: DcfComputed | { error: string } | null; + livePrice: number | null; + sharesOutstanding: number | null; + currency: string; +}; + +export function DcfResults({ dcf, computed, livePrice, sharesOutstanding, currency }: Props) { + return ( +
+
Results
+ + {computed && "error" in computed ? ( +

{computed.error}

+ ) : ( + <> +
+
+ Base FCF (TTM) + + {dcf.base_fcf != null ? fmtLarge(dcf.base_fcf, currency) : "—"} + +
+
+ Historical growth + + {dcf.growth_rate_used != null ? fmtPct(dcf.growth_rate_used) : "—"} + +
+
+ FCF PV Sum + + {computed ? fmtLarge(computed.fcfPvSum, currency) : "—"} + +
+
+ Terminal Value PV + + {computed ? fmtLarge(computed.terminalValuePv, currency) : "—"} + +
+
+ Enterprise Value + + {computed ? fmtLarge(computed.enterpriseValue, currency) : "—"} + +
+
+ Net Debt + + {dcf.net_debt != null ? fmtLarge(dcf.net_debt, currency) : "—"} + +
+
+
+ Intrinsic Value + + {livePrice != null && livePrice < 0 + ? "Invalid assumptions" + : livePrice != null + ? fmtCurrency(livePrice, 2, currency) + : "—"} + + {sharesOutstanding != null && ( + + {fmtLarge(sharesOutstanding, currency)} shares + + )} +
+ + )} +
+ ); +} -- cgit v1.3-2-g0d8e