Files
ignum/store/useCategory.ts
nabijonovdavronbek619@gmail.com d4a242b169 catalog connected to backend
2026-02-06 18:57:47 +05:00

23 lines
542 B
TypeScript

import { CategoryType } from "@/lib/types";
import { create } from "zustand";
interface CategoryZustandType {
category: CategoryType;
setCategory: (category: CategoryType) => void;
clearCatalog: () => void;
}
const demoCategory: CategoryType = {
id: 0,
name: "",
description: "",
image: "",
have_sub_category: false,
};
export const useCategory = create<CategoryZustandType>((set) => ({
category: demoCategory,
setCategory: (data) => set({ category: data }),
clearCatalog: () => set({ category: demoCategory }),
}));