detail page added

This commit is contained in:
nabijonovdavronbek619@gmail.com
2026-01-09 11:39:58 +05:00
parent 01a89edfd5
commit e53d40bd61
7 changed files with 205 additions and 189 deletions

View File

@@ -1,5 +1,6 @@
import { create } from "zustand";
import { devtools, persist } from "zustand/middleware";
import type { Product } from "@/lib/products";
interface ProductStore {
productName: string;
@@ -21,3 +22,22 @@ export const useProductStore = create<ProductStore>()(
)
)
);
interface ProductDetail {
product: Product | null;
setProducts: (product: Product) => void;
}
export const useProduct = create<ProductDetail>()(
devtools(
persist(
(set) => ({
product: null,
setProducts: (product: Product) => set({ product }),
}),
{
name: "product-detail-storage",
}
)
)
);