diff --git a/src/routes/stocks/[tickerID]/financials/cash-flow/+page.svelte b/src/routes/stocks/[tickerID]/financials/cash-flow/+page.svelte index 688f2d14..bd584692 100644 --- a/src/routes/stocks/[tickerID]/financials/cash-flow/+page.svelte +++ b/src/routes/stocks/[tickerID]/financials/cash-flow/+page.svelte @@ -17,7 +17,7 @@ import { GridComponent, TooltipComponent } from "echarts/components"; import { CanvasRenderer } from "echarts/renderers"; import FinancialTable from "$lib/components/FinancialTable.svelte"; - + import Infobox from "$lib/components/Infobox.svelte"; use([LineChart, BarChart, GridComponent, TooltipComponent, CanvasRenderer]); export let data; @@ -390,6 +390,37 @@ } } } + + + function generateStatementInfoHTML() { + if ($coolMode) { + const statementText = statementConfig?.find( + (item) => item?.propertyName === displayStatement + )?.text; + + return `${statementText || ''}`; + } else if (cashFlow?.length > 0) { + return ` + + Get detailed ratio statement breakdowns, uncovering price to free cash flow ratio, price per earnings, and much more. + + `; + } else { + return ` + + No financial data available for ${$displayCompanyName}. + + `; + } +} + +let htmlOutput = null; +$: { + if($coolMode || displayStatement) { + htmlOutput = generateStatementInfoHTML() + + } +} @@ -451,30 +482,7 @@
-
- - - {#if $coolMode} - {statementConfig?.find( - (item) => item?.propertyName === displayStatement, - )?.text} - {:else if cashFlow?.length > 0} - Get detailed ratio statement breakdowns, uncovering price to - free cash flow ratio, price per earnings, and much more. - {:else} - No financial data available for {$displayCompanyName} - {/if} -
+ {#if cashFlow?.length > 0}
@@ -613,7 +621,7 @@
-
- - - {#if $coolMode} - {statementConfig?.find( - (item) => item?.propertyName === displayStatement, - )?.text} - {:else if ratios?.length > 0} - Get detailed income statement breakdowns, uncovering revenue, - expenses, and much more. - {:else} - No financial data available for {$displayCompanyName} - {/if} -
+ {#if ratios?.length > 0}
@@ -571,7 +580,7 @@