import SidebarCard from '../shared/SidebarCard'; import type { FillerBeer } from '../../utils/filler-brewery-detail'; interface BeerStyleBreakdownCardProps { beers: FillerBeer[]; } const BeerStyleBreakdownCard = ({ beers }: BeerStyleBreakdownCardProps) => { const counts = new Map(); beers.forEach((beer) => counts.set(beer.style, (counts.get(beer.style) ?? 0) + 1)); const maxCount = Math.max(...counts.values()); const styles = [...counts.entries()].sort((a, b) => b[1] - a[1]); return ( {styles.map(([style, count]) => (
{style} {count}
))}
); }; export default BeerStyleBreakdownCard;