"use client"; import { Button } from "@/components/ui/button"; import { Badge } from "@/components/ui/badge"; import { CategoryIcon } from "@/components/ui/category-icon"; import { Pencil, Trash2 } from "lucide-react"; import { useIsMobile } from "@/hooks/use-mobile"; import type { Category } from "@/lib/types"; interface CategoryCardProps { category: Category; stats: { total: number; count: number }; formatCurrency: (amount: number) => string; onEdit: (category: Category) => void; onDelete: (categoryId: string) => void; } export function CategoryCard({ category, stats, formatCurrency, onEdit, onDelete, }: CategoryCardProps) { const isMobile = useIsMobile(); return (
{category.name} {!isMobile && ( {stats.count} opération{stats.count > 1 ? "s" : ""} •{" "} {formatCurrency(stats.total)} )} {isMobile && ( {stats.count} 💳 )} {category.keywords.length > 0 && ( {category.keywords.length} )}
); }