import { PublicOrganizationView } from "@core/Models/Company.model";
import { create } from "zustand";

export type LoginState = "started" | "success" | "sleep" | "error";

interface IOrgDataStore {
    orgData: PublicOrganizationView | null;
    setData: (data: PublicOrganizationView) => void;
    clear: () => void;
}

const useOrgDataStore = create<IOrgDataStore>()((set) => ({
    orgData: null,
    setData: (data: PublicOrganizationView) => set(() => ({ orgData: data })),
    clear: () =>
        set(() => ({
            orgData: null,
        })),
}));
export { useOrgDataStore };
