"use client"; import { TableCell, TableRow } from "@/components/ui/table"; import { useTranslations } from "next-intl"; import { type ReactNode } from "react"; const PLACEHOLDER_ROW_COUNT = 5; const COMPACT_PLACEHOLDER_ROW_COUNT = 2; type DataTableEmptyStateProps = { colSpan: number; action?: ReactNode; message?: string; compact?: boolean; }; export function DataTableEmptyState({ colSpan, action, message, compact = false }: DataTableEmptyStateProps) { const t = useTranslations(); const placeholderRows = compact ? COMPACT_PLACEHOLDER_ROW_COUNT : PLACEHOLDER_ROW_COUNT; const minHeightClass = compact ? "min-h-[4.5rem]" : "min-h-[11rem]"; return (
{Array.from({ length: placeholderRows }).map((_, i) => (
))}

{message ?? t("noResults")}

{action}
); }