import React from 'react'; import CountBadge from './CountBadge.tsx'; const AccordionItem: React.FC<{ id: string; title: string; count: number; icon: string; level: 'location' | 'coop' | 'floor'; children?: React.ReactNode; isOpen: boolean; onToggle: (id: string) => void; }> = ({ id, title, count, icon, level, children, isOpen, onToggle }) => { const levelStyles = { location: { button: 'bg-gray-100 hover:bg-gray-200', icon: 'text-gray-600', title: 'text-lg font-bold text-gray-800', }, coop: { button: 'bg-white hover:bg-gray-50', icon: 'text-gray-500', title: 'font-semibold text-gray-700', }, floor: { button: 'bg-white', icon: 'text-gray-500', title: 'font-medium text-gray-700', }, }; const styles = levelStyles[level]; return (
{title}
{children && ( )}
{isOpen &&
{children}
}
); }; export default AccordionItem;