export interface RowDataType {
  id: string | number;
  [key: string]: unknown;
}

export interface ColumnType<T extends RowDataType> {
  title: string;
  key: string;
  align?: "left" | "center" | "right";
  className?: string;
  width?: string | number;
  render?: (item: T, index?: number) => React.ReactNode;
}

export interface PaginationType {
  currentPage: number;
  totalPages: number;
  onPageChange: (page: number) => void;
}

export interface ActionType {
  label: string;
  onClick: () => void;
  icon?: React.ReactNode;
  className?: string;
  disabled?: boolean;
}

export interface TableProps<T extends RowDataType> {
  columns: ColumnType<T>[];
  data?: T[];
  isloading?: boolean;
  onRowClick?: (id: string | number, item: T) => void;
  className?: string;
  rowClassName?: string | ((item: T, index: number) => string);
  noDataMessage?: string;
  headerClassName?: string;
  emptyRowsCount?: number;
  showHeader?: boolean;
  actions?: React.ReactNode;
  actionsPosition?: "top" | "above-header" | "bottom" | "header-replace";
  selectable?: boolean;
  selectedActions?: React.ReactNode;
  onSelectionChange?: (selectedRows: T[]) => void;
  rowActions?: (item: T) => ActionType[];
  pagination?: PaginationType;
}
