import dynamic from 'next/dynamic';
import type { ComponentType } from 'react';
import type { DataTableProps } from 'mantine-datatable';

// Dynamic import menghindari stale Turbopack chunk saat navigasi antar halaman
export const DataTable = dynamic(() => import('mantine-datatable').then((mod) => mod.DataTable), {
    ssr: false,
    loading: () => (
        <div className="flex min-h-[250px] items-center justify-center text-white-dark">
            Loading table...
        </div>
    ),
}) as ComponentType<DataTableProps<any>>;

export type { DataTableProps, DataTableSortStatus, DataTableColumn } from 'mantine-datatable';
