import {create} from 'zustand';

interface CouponStore {
    selectedCouponName: string;
    selectedCouponRedeemCode: string;
    selectedCouponPrice: string;
    setSelectedCouponName: (name: string) => void;
    setSelectedCouponPrice: (price: string) => void;
    setSelectedCouponRedeemCode: (redeemCode: string) => void;
}

const useCouponStore = create<CouponStore>((set) => ({
    selectedCouponName: '',
    selectedCouponRedeemCode: '',
    selectedCouponPrice: '',
    setSelectedCouponName: (name) => set({ selectedCouponName: name }),
    setSelectedCouponPrice: (price) => set({ selectedCouponPrice: price }),
    setSelectedCouponRedeemCode: (redeemCode) =>
        set({ selectedCouponRedeemCode: redeemCode })
}));

export default useCouponStore;
