import { Box, Typography } from '@mui/material' import { styles } from '../style' import { CategoryBar } from './category-bar' import type { CategoryWidgetConfig } from '../types' export interface CategoryRowSingleProps { name: string value: number maxValue: number color: string formatter: NonNullable labelFormatter?: CategoryWidgetConfig['labelFormatter'] onClick?: CategoryWidgetConfig['onRowClick'] selected?: boolean } /** * Renders a single-series category row with a label, formatted value, and proportional bar. */ export function CategoryRowSingle({ name, value, maxValue, color, formatter, labelFormatter, onClick, selected = true, }: CategoryRowSingleProps) { const handleClick = onClick ? () => onClick({ name, }) : undefined const rowStyle = onClick ? styles.rowClickable : styles.row return ( {labelFormatter ? labelFormatter(name) : name} {formatter(value)} ) }