feat: make billing better (#203)
This commit is contained in:
20
apps/web/src/store/upgradeModalStore.ts
Normal file
20
apps/web/src/store/upgradeModalStore.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { create } from "zustand";
|
||||
import { LimitReason } from "~/lib/constants/plans";
|
||||
|
||||
interface UpgradeModalStore {
|
||||
isOpen: boolean;
|
||||
reason?: LimitReason;
|
||||
action: {
|
||||
openModal: (reason?: LimitReason) => void;
|
||||
closeModal: () => void;
|
||||
};
|
||||
}
|
||||
|
||||
export const useUpgradeModalStore = create<UpgradeModalStore>((set) => ({
|
||||
isOpen: false,
|
||||
reason: undefined,
|
||||
action: {
|
||||
openModal: (reason?: LimitReason) => set({ isOpen: true, reason }),
|
||||
closeModal: () => set({ isOpen: false, reason: undefined }),
|
||||
},
|
||||
}));
|
Reference in New Issue
Block a user