import { create } from 'zustand';

import { UserState } from '../types/user';

const userStore = create<UserState>((set) => ({
    user: {
        address: '',
        birthday: '',
        license_plate: '',
        email: '',
        // firstname: null,
        gender: '',
        nickname: '',
        phone: null
    },
    setUser: (newUserData) =>
        set((state) => ({
            user: {
                ...state.user,
                ...newUserData
            }
        }))
}));

export default userStore;
