* feat: Modal for gated features * use zustand * refactor * Apply suggestions from code review Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * Update packages/ui/components/card/Card.tsx Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * dismiss button fix and url fix * fix: broken redirect to teams * fix: type check and review comments * add learn more tracking back --------- Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
20 lines
517 B
TypeScript
20 lines
517 B
TypeScript
import { create } from "zustand";
|
|
|
|
export enum GatedFeatures {
|
|
RolesAndPermissions = "roles_and_permissions",
|
|
}
|
|
|
|
type GatedFeaturesStore = {
|
|
isOpen: boolean;
|
|
activeFeature: GatedFeatures | null;
|
|
open: (feature: GatedFeatures) => void;
|
|
close: () => void;
|
|
};
|
|
|
|
export const useGatedFeaturesStore = create<GatedFeaturesStore>((set) => ({
|
|
isOpen: false,
|
|
activeFeature: null,
|
|
open: (feature) => set({ isOpen: true, activeFeature: feature }),
|
|
close: () => set({ isOpen: false, activeFeature: null }),
|
|
}));
|