import PageBlock from "../../../../../../components/PageBlock/PageBlock.tsx";
import { MantineReactTable } from "mantine-react-table";
import { useProfitTable } from "./hooks/useProfitTable.tsx";
import { Skeleton } from "@mantine/core";
import { ProfitFiltersModal } from "../../modals/ProfitFiltersModal.tsx";


export const ProfitTable = () => {
    const { table, form, isLoading } = useProfitTable();

    return (
        <PageBlock style={{ flex: 2, minWidth: "600px", padding: "25px" }}>
            <ProfitFiltersModal form={form} />
            <Skeleton visible={isLoading}>
                <MantineReactTable table={table} />
            </Skeleton>
        </PageBlock>
    );
};