2026-08-14 10:49:44 +07:00
|
|
|
|
import type { AreaPoint } from "@/components/charts/area-activity";
|
|
|
|
|
|
import { AreaActivity } from "@/components/charts/area-activity";
|
2026-08-01 23:06:00 +07:00
|
|
|
|
|
2026-08-14 10:49:44 +07:00
|
|
|
|
export interface HourlyActivityChartProps {
|
|
|
|
|
|
data: { hour: number; messages: number; flagged: number }[];
|
2026-08-01 23:06:00 +07:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-08-14 10:49:44 +07:00
|
|
|
|
export function HourlyActivityChart({ data }: HourlyActivityChartProps) {
|
|
|
|
|
|
const points: AreaPoint[] = data.map((d) => ({
|
|
|
|
|
|
label: `${d.hour}:00`,
|
|
|
|
|
|
value: d.messages,
|
|
|
|
|
|
}));
|
2026-08-01 23:06:00 +07:00
|
|
|
|
return (
|
2026-08-14 10:49:44 +07:00
|
|
|
|
<div className="surface p-4">
|
|
|
|
|
|
<div className="mb-3 flex items-center justify-between">
|
|
|
|
|
|
<h3 className="text-sm font-semibold">Hourly distribution</h3>
|
|
|
|
|
|
<span className="text-xs text-[var(--color-ink-soft)]">
|
|
|
|
|
|
00:00 – 23:00
|
2026-08-01 23:06:00 +07:00
|
|
|
|
</span>
|
|
|
|
|
|
</div>
|
2026-08-14 10:49:44 +07:00
|
|
|
|
<AreaActivity
|
|
|
|
|
|
data={points}
|
|
|
|
|
|
height={140}
|
|
|
|
|
|
stroke="var(--color-amber)"
|
|
|
|
|
|
label="Hourly message activity"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
2026-08-01 23:06:00 +07:00
|
|
|
|
);
|
|
|
|
|
|
}
|