feat(ui): add Local Server Cloud upgrade prompts (#11982)

This commit is contained in:
Alejandro Bailo
2026-07-15 12:11:28 +02:00
committed by GitHub
parent 077dff7f68
commit faa74f4c6c
68 changed files with 1687 additions and 429 deletions
+29
View File
@@ -0,0 +1,29 @@
import { create } from "zustand";
import type { CloudUpgradeFeature } from "@/types/cloud-upgrade";
interface CloudUpgradeStoreState {
activeFeature: CloudUpgradeFeature | null;
returnFocusElement: HTMLElement | null;
openCloudUpgrade: (
feature: CloudUpgradeFeature,
returnFocusElement?: HTMLElement,
) => void;
closeCloudUpgrade: () => void;
}
// Upgrade prompts are ephemeral and shared so only one modal can be open.
export const useCloudUpgradeStore = create<CloudUpgradeStoreState>((set) => ({
activeFeature: null,
returnFocusElement: null,
openCloudUpgrade: (activeFeature, requestedReturnFocusElement) =>
set({
activeFeature,
returnFocusElement:
requestedReturnFocusElement ??
(document.activeElement instanceof HTMLElement
? document.activeElement
: null),
}),
closeCloudUpgrade: () => set({ activeFeature: null }),
}));
+1
View File
@@ -1,3 +1,4 @@
export * from "./cloud-upgrade/store";
export * from "./organizations/store";
export * from "./provider-wizard/store";
export * from "./scans/store";