import { create } from 'zustand' import { persist } from 'zustand/middleware' interface AuthState { token: string | null memberId: string | null organizationId: string | null email: string | null setAuth: (token: string, memberId: string, organizationId: string | null, email?: string | null) => void logout: () => void } export const useAuth = create()( persist( (set) => ({ token: null, memberId: null, organizationId: null, email: null, setAuth: (token, memberId, organizationId, email = null) => set({ token, memberId, organizationId, email }), logout: () => set({ token: null, memberId: null, organizationId: null, email: null }), }), { name: 'teamup-auth' }, ), )