"use client";

import { Group } from "@mantine/core";
import { useProjectsContext } from "@/app/deals/contexts/ProjectsContext";
import ProjectSelect from "@/components/selects/ProjectSelect/ProjectSelect";

const Header = () => {
    const { projects, setSelectedProject, selectedProject } =
        useProjectsContext();

    return (
        <Group
            justify={"flex-end"}
            w={"100%"}>
            <ProjectSelect
                data={projects}
                value={selectedProject}
                onChange={value => value && setSelectedProject(value)}
            />
        </Group>
    );
};

export default Header;
