file name and location updayed for better be
This commit is contained in:
20
zustand/useSubCategory.ts
Normal file
20
zustand/useSubCategory.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
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 }),
|
||||
}));
|
||||
Reference in New Issue
Block a user