import { Section } from "./section"; import { formatCount, formatNullableCount } from "./format"; import type { OverviewStats, StatusNotice, ThemeName, ViewState } from "./types"; export type CauseWiseStatsProps = { stats?: OverviewStats | null; theme?: ThemeName; state?: ViewState; error?: StatusNotice | null; className?: string; headingLevel?: 2 | 3; }; export function CauseWiseStats({ stats, theme, state = "ready", error, className, headingLevel, }: CauseWiseStatsProps) { return (
{stats ? (
Pageviews
{formatCount(stats.pageviews)}
Sessions
{formatCount(stats.sessions)}
Visitors
{formatNullableCount(stats.visitors)}
{stats.visitorsNote ?

{stats.visitorsNote}

: null}
) : null}
); }