import './Table.css'; /** * Table header definition. * @property key - The column key. * @property nameDisplay - Optional display name for the column. */ export type HeaderType = { key: string; nameDisplay?: string; }; /** * Table row values: array of objects with value and key. * Each object represents a cell in the row. * @property value - The cell value (string, number, or React node). * @property key - The column key for this cell. */ export type TableRowValues = { value: string | number | React.ReactNode; key: string; }[]; /** * Table row details: record of string keys to string | number | React.ReactNode. * Used for expandable details section. * @example * { * description: "Extra info", * count: 5 * } */ export type TableRowDetails = Record; /** * Table row data: values and details. * @property values - The main row cell values. * @property details - The expandable details for the row. * @property isExpanded - Whether the row is expanded (optional). */ export type TableRowData = { values: TableRowValues; details: TableRowDetails; isExpanded?: boolean; }; /** * Table row tools: React node or function returning a React node for a row. * Used to render custom controls or actions for each row. */ export type TableRowTools = React.ReactNode | ((data: TableRowData) => React.ReactNode); /** * Generic TableComponent props. * @template T - The type of each row in the table data. * @property data - The array of row data objects. * @property className - Optional CSS class for the table. * @property expandable - If true, enables expandable rows. * @property highlightOnHover - If true, highlights rows on hover. * @property expandableSectionKey - The key in data objects for expandable details. * @property expandButtonTooltip - Tooltip text for the expand button. * @property headers - Optional array of header definitions. * @property rowTools - Optional custom tools for each row. * @property onExpandButtonClick - Optional callback when a row is expanded/collapsed. */ export type TableProps> = { data: Array; className?: string; expandable?: boolean; highlightOnHover?: boolean; expandableSectionKey?: string; expandButtonTooltip?: string; headers?: Array; rowTools?: TableRowTools; onExpandButtonClick?: (data: TableRowData, expanded: boolean) => void; }; /** * TableComponent renders a table with optional expandable rows and custom tools. * * - Uses headers from props if provided, otherwise extracts from data. * - Supports expandable rows with details. * - Tools can be rendered in the last column. * * @template T - The type of each row in the table data. * @param {TableProps} props - The props for the TableComponent. * @returns {JSX.Element} The rendered table. */ export declare const TableComponent: >({ data, className, headers, expandable, highlightOnHover, expandableSectionKey, expandButtonTooltip, rowTools, onExpandButtonClick, }: TableProps) => import("react/jsx-runtime").JSX.Element;