import { useState } from 'react' import { ChevronLeft, FolderPlus, Pencil, SlidersHorizontal, Trash2, } from 'lucide-react' import type { Category } from '../data/categories' import styles from './CategoryItem.module.css' type CategoryItemProps = { category: Category depth?: number onAddChild: (parentId: string) => void onEdit: (category: Category) => void onOpenOptions: (category: Category) => void onRemove: (id: string) => void } export function CategoryItem({ category, depth = 0, onAddChild, onEdit, onOpenOptions, onRemove, }: CategoryItemProps) { const hasChildren = category.children.length > 0 const [open, setOpen] = useState(false) function toggleOpen() { if (!hasChildren) return setOpen((value) => !value) } return (