2024-12-06 14:16:05 +05:00
|
|
|
import type { Device } from "@prisma/client";
|
|
|
|
import { atom, createStore } from "jotai";
|
|
|
|
|
|
|
|
// Create a single store instance
|
|
|
|
export const store = createStore();
|
|
|
|
|
|
|
|
// Create atoms with the store
|
|
|
|
export const initialPriceAtom = atom(100);
|
|
|
|
export const discountPercentageAtom = atom(75);
|
|
|
|
export const numberOfDevicesAtom = atom(1);
|
|
|
|
export const numberOfDaysAtom = atom(30);
|
2024-12-07 14:09:53 +05:00
|
|
|
export const numberOfMonths = atom(1);
|
2024-12-25 17:21:04 +05:00
|
|
|
export const walletTopUpValue = atom(1);
|
2024-12-06 14:16:05 +05:00
|
|
|
export const formulaResultAtom = atom("");
|
|
|
|
export const deviceCartAtom = atom<Device[]>([]);
|
|
|
|
export const cartDrawerOpenAtom = atom(false);
|
2024-12-25 17:21:04 +05:00
|
|
|
export const WalletDrawerOpenAtom = atom(false);
|
|
|
|
|
2024-12-06 14:16:05 +05:00
|
|
|
// Export the atoms with their store
|
|
|
|
export const atoms = {
|
|
|
|
initialPriceAtom,
|
|
|
|
discountPercentageAtom,
|
|
|
|
numberOfDevicesAtom,
|
|
|
|
numberOfDaysAtom,
|
2024-12-07 14:09:53 +05:00
|
|
|
numberOfMonths,
|
2024-12-06 14:16:05 +05:00
|
|
|
formulaResultAtom,
|
|
|
|
deviceCartAtom,
|
|
|
|
cartDrawerOpenAtom,
|
2024-12-25 17:21:04 +05:00
|
|
|
walletTopUpValue,
|
2024-12-06 14:16:05 +05:00
|
|
|
};
|