waveterm/frontend/app/modals/modalregistry.tsx
Sylvie Crowe 555ab07861
Add Tips Modal for Directory (#374)
This is an experimental modal to show tips. If it helps improve
discoverability, it will be improved in the future.
2024-09-13 03:36:15 -07:00

19 lines
674 B
TypeScript

// Copyright 2024, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0
import { AboutModal } from "./about";
import { TipsModal } from "./tipsmodal";
import { TosModal } from "./tos";
import { UserInputModal } from "./userinputmodal";
const modalRegistry: { [key: string]: React.ComponentType<any> } = {
[TosModal.displayName || "TosModal"]: TosModal,
[UserInputModal.displayName || "UserInputModal"]: UserInputModal,
[AboutModal.displayName || "AboutModal"]: AboutModal,
[TipsModal.displayName || "TipsModal"]: TipsModal,
};
export const getModalComponent = (key: string): React.ComponentType<any> | undefined => {
return modalRegistry[key];
};