import { Icon } from '@iconify/react';
import ClosingTabSkeleton from './ClosingTabSkeleton';
import { ColumnDef } from '@tanstack/react-table';

const SapronakClosingSkeleton = <T extends object>({
  columns,
  type = 'incoming',
  title,
  subtitle,
  iconName = 'heroicons:chart-bar',
}: {
  columns: ColumnDef<T, unknown>[];
  type?: 'incoming' | 'outgoing';
  title?: string;
  subtitle?: string;
  iconName?: string;
}) => {
  const defaultTitle =
    type === 'incoming'
      ? 'Data Sapronak Masuk Belum Tersedia'
      : 'Data Sapronak Keluar Belum Tersedia';

  const defaultSubtitle =
    type === 'incoming'
      ? 'Tidak ada data sapronak masuk untuk periode ini.'
      : 'Tidak ada data sapronak keluar untuk periode ini.';

  return (
    <ClosingTabSkeleton<T>
      columns={columns}
      icon={
        <Icon icon={iconName} className='text-white' width={20} height={20} />
      }
      title={title || defaultTitle}
      subtitle={subtitle || defaultSubtitle}
    />
  );
};

export default SapronakClosingSkeleton;
