import { Eye, Pencil, Trash2, type LucideIcon } from "lucide-react"; import { useTranslation } from "react-i18next"; export interface TableAction { icon: LucideIcon; title: string; onClick: () => void; disabled?: boolean; destructive?: boolean; } interface TableActionsProps { onView?: () => void; onEdit?: () => void; onDelete?: () => void; isDeleting?: boolean; editIcon?: LucideIcon; extraActions?: TableAction[]; } export function TableActions({ onView, onEdit, onDelete, isDeleting, editIcon: EditIcon = Pencil, extraActions }: TableActionsProps) { const { t } = useTranslation(); return (
{extraActions?.map((action, i) => ( ))} {onView && ( )} {onEdit && ( )} {onDelete && ( )}
); }