import { createStore } from "zustand/vanilla"; export type AttachmentState = { attachmentFileCode: string; }; export type AttachmentActions = { setAttachmentFileCode: (attachmentFileCode: string) => void; }; export type AttachmentStore = AttachmentState & AttachmentActions; export const defaultInitState: AttachmentState = { attachmentFileCode: "", }; export const createAttachmentStore = ( initState: AttachmentState = defaultInitState, ) => { return createStore()((set) => ({ ...initState, setAttachmentFileCode: (attachmentFileCode: string) => set({ attachmentFileCode }), })); };