Files
ignum/zustand/useSubCategory.ts
2026-03-07 16:31:18 +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 }),
}));