import React from 'react'; import { cn } from '../../utils/cn'; export interface TableEmptyProps { /** * Empty state title text * @default 'No data' */ title?: string; /** * Empty state message text * @default 'No data available' */ message?: string; /** * Custom icon to display */ icon?: React.ReactNode; /** * Number of columns to span * @default 1 */ colSpan?: number; /** * Whether to display a refresh/reload button * @default false */ showRefresh?: boolean; /** * Function to call when refresh button is clicked */ onRefresh?: () => void; /** * Custom refresh button text * @default 'Refresh' */ refreshText?: string; /** * Additional CSS classes */ className?: string; /** * Custom content to render instead of the default empty state */ children?: React.ReactNode; } /** * TableEmpty component - Shown when table has no data */ export const TableEmpty: React.FC = ({ title = 'No data', message = 'No data available', icon, colSpan = 1, showRefresh = false, onRefresh, refreshText = 'Refresh', className, children, }) => { // Default empty state icon const defaultIcon = ( ); return ( {children || (
{icon || defaultIcon}

{title}

{message}

{showRefresh && onRefresh && ( )}
)} ); }; export default TableEmpty;