import { create } from "zustand"; type State = { form: { username: string; password: string; }; }; type Action = { updateForm: (name: string, value: string) => void; }; export const useLoginStore = create((set) => ({ form: { username: "", password: "", }, updateForm: (name, value) => set((state) => ({ form: { ...state.form, [name]: value, }, })), }));