import { Fragment } from 'react'
import { ReportWidgetProps, ReportWidgetRendererProps } from '../ReportWidget'
import { TextFormatter } from '@/components/interfaces/Settings/Logs/LogsFormatters'
import Table from '@/components/to-be-cleaned/Table'
import StackedBarChart from '@/components/ui/Charts/StackedBarChart'
export const CacheHitRateChartRenderer = (
props: ReportWidgetProps<{
timestamp: string
hit_count: number
miss_count: number
}>
) => {
const stackedData = props.data.flatMap((datum) => [
{
timestamp: +datum.timestamp / 1000,
count: datum.hit_count,
type: 'hit',
},
{
timestamp: +datum.timestamp / 1000,
count: datum.miss_count,
type: 'miss',
},
])
return (