import { type FC, type ReactNode, type ThHTMLAttributes } from 'react';
import styles from './Table.module.css';
import { Icon } from '../../icons';
import { TableWrapper } from './TableWrapper';
import type { RefProp } from '../../lib/react';
export interface TableProps extends RefProp {
children: ReactNode,
width?: 'page' | 'auto',
}
export interface HeaderCellProps {
children?: ReactNode,
small?: boolean,
align?: ThHTMLAttributes['align'],
colSpan?: ThHTMLAttributes['colSpan'],
width?: number | string,
sort?: boolean | 'asc' | 'desc',
onSort?: () => void,
}
const TableComponent: FC = ({ width = 'page', children, ref }) => (
);
TableComponent.displayName = 'Table';
const HeaderCell: FC = ({ children, small = false, align, colSpan, width, sort, onSort }: HeaderCellProps) => (
|
{sort ? (
) : children}
|
);
HeaderCell.displayName = 'Table.HeaderCell';
export const Table = Object.assign(TableComponent, { HeaderCell });