'use client'; import { View, StyleSheet } from '@react-pdf/renderer'; import type { PdfColumn } from './types'; import { PdfThead } from './PdfThead'; import { PdfTbody } from './PdfTbody'; import { PdfTfoot } from './PdfTfoot'; const styles = StyleSheet.create({ table: { borderWidth: 1, borderColor: '#000000', marginBottom: 15, }, }); interface PdfTableProps> { columns: PdfColumn[]; data: TData[]; showFooter?: boolean; footerLabel?: string; firstRow?: { valueKey: string; value: number; align?: 'right'; color?: string; }; } export const PdfTable = ,>({ columns, data, showFooter = false, footerLabel = 'Total', firstRow, }: PdfTableProps) => { // Check if any column has footer defined const hasFooter = showFooter || columns.some((col) => col.footer !== undefined); return ( {hasFooter && data.length > 0 && ( )} ); }; export type { PdfColumn };