diff options
Diffstat (limited to 'frontend/app/page.tsx')
| -rw-r--r-- | frontend/app/page.tsx | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/frontend/app/page.tsx b/frontend/app/page.tsx index 6f7e5b6..3bec411 100644 --- a/frontend/app/page.tsx +++ b/frontend/app/page.tsx @@ -499,6 +499,16 @@ function ProfileCard({ overview }: { overview: TickerOverview }) { function ShortInterestCard({ overview }: { overview: TickerOverview }) { const short = overview.short_interest; + const items = [ + { label: "Short Float", value: fmtPct(short.short_percent_of_float), missing: short.short_percent_of_float == null }, + { label: "Days Cover", value: fmtNumber(short.short_ratio), missing: short.short_ratio == null }, + { label: "Shares Short", value: fmtNumber(short.shares_short, 0), missing: short.shares_short == null }, + { label: "Prior Delta", value: fmtPct(short.shares_short_delta_pct, 1, true), missing: short.shares_short_delta_pct == null } + ]; + const visibleItems = items.filter((i) => !i.missing); + if (!visibleItems.length) return null; + const suppressed = items.length - visibleItems.length; + return ( <section className="psm-card"> <div className="psm-card-head"> @@ -508,11 +518,13 @@ function ShortInterestCard({ overview }: { overview: TickerOverview }) { </div> </div> <div className="psm-detail-grid"> - <DetailItem label="Short Float" value={fmtPct(short.short_percent_of_float)} missing={short.short_percent_of_float == null} /> - <DetailItem label="Days Cover" value={fmtNumber(short.short_ratio)} missing={short.short_ratio == null} /> - <DetailItem label="Shares Short" value={fmtNumber(short.shares_short, 0)} missing={short.shares_short == null} /> - <DetailItem label="Prior Delta" value={fmtPct(short.shares_short_delta_pct, 1, true)} missing={short.shares_short_delta_pct == null} /> + {visibleItems.map((item) => ( + <DetailItem key={item.label} label={item.label} value={item.value} missing={false} /> + ))} </div> + {suppressed > 0 && ( + <p className="psm-muted-copy" style={{ marginTop: "var(--sp-3)" }}>ยท Short interest data incomplete</p> + )} </section> ); } |
