Files
ignum/store/useProceModalStore.ts
nabijonovdavronbek619@gmail.com 63b363b142 priceContact added
2026-02-01 19:19:46 +05:00

22 lines
494 B
TypeScript

import { create } from 'zustand';
interface Product {
id: number;
name: string;
image: string;
inStock: boolean;
}
interface PriceModalStore {
isOpen: boolean;
product: Product | null;
openModal: (product: Product) => void;
closeModal: () => void;
}
export const usePriceModalStore = create<PriceModalStore>((set) => ({
isOpen: false,
product: null,
openModal: (product) => set({ isOpen: true, product }),
closeModal: () => set({ isOpen: false, product: null }),
}));