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

21 lines
551 B
TypeScript

import { SubCategoryType } from "@/lib/types";
import { create } from "zustand";
interface SubCategoryZustandType {
subCategory: SubCategoryType;
setSubCategory: (subCategory: SubCategoryType) => void;
clearSubCategory: () => void;
}
const demoSubCategory = {
id: 0,
name: "",
category: 0,
image: "",
};
export const useSubCategory = create<SubCategoryZustandType>((set) => ({
subCategory: demoSubCategory,
setSubCategory: (data) => set({ subCategory: data }),
clearSubCategory: () => set({ subCategory: demoSubCategory }),
}));