import { ReactNode } from 'react';

/**
 * PdfColumn - Mirip dengan ColumnDef di TanStack Table
 * Mengatur header (thead), body (tbody), dan footer (tfoot) dalam satu definisi
 */
export interface PdfColumn<TData = Record<string, unknown>> {
  key: string;
  flex?: number;

  // Header configuration (thead)
  header?: string | ((data: TData[]) => ReactNode);

  // Body configuration (tbody)
  align?: 'left' | 'center' | 'right';
  cell?: (props: { row: TData; index: number }) => ReactNode | string | number;

  // Footer configuration (tfoot)
  footer?: string | number | ((data: TData[]) => ReactNode | string | number);
  footerAlign?: 'left' | 'center' | 'right';
  footerColor?: string;
}

export type { PdfColumn as default };
