import { create } from "zustand" import type { UserRole } from "@/lib/types" interface AuthState { isAuthenticated: boolean currentRole: UserRole switchRole: (role: UserRole) => void login: () => void logout: () => void } export const useAuthStore = create((set) => ({ isAuthenticated: false, currentRole: "consumer", switchRole: (role) => set({ currentRole: role }), login: () => set({ isAuthenticated: true }), logout: () => set({ isAuthenticated: false, currentRole: "consumer" }), }))