subcategory zustand fixed and created product zustand for get product detail information
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
import { ProductsPageTypes } from "@/lib/types";
|
||||||
|
import { create } from "zustand";
|
||||||
|
|
||||||
|
const demoProductPageData = {
|
||||||
|
id: 0,
|
||||||
|
name: "",
|
||||||
|
image: "",
|
||||||
|
};
|
||||||
|
|
||||||
|
interface ProductPageZustanType {
|
||||||
|
product: ProductsPageTypes;
|
||||||
|
setProducts: (data: ProductsPageTypes) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useProductPageInfo = create<ProductPageZustanType>((set) => ({
|
||||||
|
product: demoProductPageData,
|
||||||
|
setProducts: (data) => set({ product: data }),
|
||||||
|
}));
|
||||||
|
|||||||
@@ -14,5 +14,5 @@ const demoSubCategory = {
|
|||||||
};
|
};
|
||||||
export const useSubCategory = create<SubCategoryZustandType>((set) => ({
|
export const useSubCategory = create<SubCategoryZustandType>((set) => ({
|
||||||
subCategory: demoSubCategory,
|
subCategory: demoSubCategory,
|
||||||
setSubCategory: (data) => set({}),
|
setSubCategory: (data) => set({ subCategory: data }),
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user