import type React from 'react' import { Link } from '@tanstack/react-router' interface HorizontalBarsRow { label: string count: number href?: string } interface HorizontalBarsProps { rows: HorizontalBarsRow[] max: number } export function HorizontalBars({ rows, max }: HorizontalBarsProps): React.JSX.Element { const safeMax = max > 0 ? max : 1 return (
{rows.map((row, i) => { const ratio = row.count / safeMax const label = row.href != null ? ( {row.label} ) : ( {row.label} ) return (
{label}
{row.count}
) })}
) }