import { create } from "zustand";

interface IAppointmentsViewStore {
    collaboratorId: string;
    setCollaboratorId: (id: string) => void;
    clear: () => void;
}

export type AppointmentsState = IAppointmentsViewStore;

const useAppointmentsViewStore = create<AppointmentsState>()((set) => ({
    collaboratorId: "",
    setCollaboratorId: (id: string) => set(() => ({ collaboratorId: id })),
    clear: () =>
        set(() => ({
            collaboratorId: "",
        })),
}));

export { useAppointmentsViewStore };
