import { Group, Stack } from "@mantine/core";
import ClientSelect from "../../../../components/Selects/ClientSelect/ClientSelect.tsx";
import ResiduesHeader from "../ResiduesHeader/ResiduesHeader.tsx";
import ResiduesTree from "../ResiduesTree/ResiduesTree.tsx";
import { useResiduesContext } from "../../contexts/ResiduesContext.tsx";

const ResiduesPageContent = () => {
    const { selectedClient, selectClient } = useResiduesContext();

    return (
        <Stack h="92vh">
            <Group>
                <ClientSelect onChange={selectClient} />
                {selectedClient && <ResiduesHeader />}
            </Group>
            {selectedClient && <ResiduesTree />}
        </Stack>
    );
};

export default ResiduesPageContent;
