:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
import { useValues } from 'kea'
import { Text } from '@posthog/quill'
import { SignalReport } from 'products/signals/frontend/inbox/types'
import { TodayFigureMark } from './TodayFigureMark'
import { TodayInlineTrend } from './TodayInlineTrend'
import { TodayMarkedText } from './TodayMarkedText'
import { todayReportLogic } from './todayReportLogic'
export function TodayReportAbstract({ report }: { report: SignalReport }): JSX.Element | null {
const {
impactNumbers: numbers,
impactText,
impactMarks,
shownKeyClauses,
} = useValues(todayReportLogic({ reportId: report.id }))
if (numbers.length === 0 && !impactText) {
return null
}
if (numbers.length === 0) {
return (
<div data-attr="today-report-abstract" data-today-figures>
<Text size="sm" render={<p />} className="leading-relaxed text-pretty">
<TodayMarkedText
markdown={impactText}
marked={impactMarks}
keyClauses={shownKeyClauses?.impact ?? []}
reportId={report.id}
/>
</Text>
</div>
)
}
return (
<ul className="m-0 flex list-none flex-col gap-3 p-0" aria-label="Impact" data-attr="today-report-abstract">
{numbers.map((number, index) => (
<li key={number.key} className="flex flex-col gap-0.5">
<Text size="sm" render={<span />} className="text-pretty">
<TodayFigureMark
figure={number.value}
content={number.content}
reportId={report.id}
order={index}
kind="impact"
>
<span translate="no" className="tabular-nums">
{number.value}
</span>
</TodayFigureMark>
<span>{` ${number.label}`}</span>
</Text>
{number.window && (
<Text size="xs" variant="muted" render={<span />} className="flex items-center gap-2">
<span>{number.window}</span>
{number.chart && (
<TodayInlineTrend
values={number.chart.data}
type={number.chart.type}
partialLast={number.chart.partialLast}
/>
)}
</Text>
)}
</li>
))}
</ul>
)
}