mirror of
https://github.com/supabase/supabase.git
synced 2026-06-21 22:12:50 +08:00
26 lines
678 B
TypeScript
26 lines
678 B
TypeScript
import BarChart from 'components/ui/Charts/BarChart'
|
|
import type { Datum } from 'components/ui/Charts/Charts.types'
|
|
import { EventChartData } from '.'
|
|
|
|
export interface LogEventChartProps {
|
|
data: EventChartData[]
|
|
onBarClick: (isoTimestamp: string) => void
|
|
}
|
|
|
|
const LogEventChart = ({ data, onBarClick }: LogEventChartProps) => (
|
|
<BarChart
|
|
minimalHeader
|
|
size="tiny"
|
|
yAxisKey="count"
|
|
xAxisKey="timestamp"
|
|
data={data}
|
|
title="Logs / Time"
|
|
onBarClick={(datum: Datum | EventChartData) => {
|
|
if (!datum.timestamp) return
|
|
onBarClick(datum.timestamp as string)
|
|
}}
|
|
customDateFormat="MMM D, HH:mm:s"
|
|
/>
|
|
)
|
|
export default LogEventChart
|