import { create } from 'zustand';

type State = {
  token: string | null;
};

type Actions = {
  savedToken: (token: string | null) => void;
};

const useTokenStore = create<State & Actions>((set) => ({
  token: null,
  savedToken: (token: string | null) => set(() => ({ token })),
}));

export default useTokenStore;
