import { create } from 'zustand';
import { UserRes } from './api';

type State = {
  user: UserRes | null;
};

type Actions = {
  setUser: (qty: UserRes | null) => void;
};

export const userStore = create<State & Actions>((set) => ({
  user: null,
  setUser: (user: UserRes | null) => set(() => ({ user })),
}));
