import { Discount } from "@frontend/kitui"
import { create } from "zustand"
import { devtools } from "zustand/middleware"


interface DiscountStore {
    discounts: Discount[];
}

export const useDiscountStore = create<DiscountStore>()(
	devtools(
		(set, get) => ({
			discounts: []
		}),
		{
			name: "Discounts",
			enabled: process.env.NODE_ENV === "development",
		}
	)
)

export const setDiscounts = (discounts: DiscountStore["discounts"]) => useDiscountStore.setState({ discounts })
