Loading...
} > ); } export interface StatsPieProps { data: StatsResult[] } export function StatsPie({ data }: StatsPieProps) { const labels = data.map((d) => d.name); const values = data.map((d) => d.count); const piedata = { labels, datasets: [{ label: "# of attempts", data: values, backgroundColor: chartColors, borderWidth: 1 }] }; console.log(piedata) const getTextColor = () => { return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'white' : 'black' } const options: ChartOptions<"pie"> = { plugins: { legend: { display: true, align: "start", labels: { color: getTextColor(), } } } } return (Loading...
} > ); } export interface TotalsProps { totals: TotalStats } export function Totals({ totals }: TotalsProps) { return (Date | Username | Password | IP | Country |
---|
Error: {message}