Closes #9423 https://github.com/user-attachments/assets/0d93f170-8c4f-43ff-a0ca-3d2874d44820
24 lines
807 B
TypeScript
24 lines
807 B
TypeScript
import { CommandMenuContainer } from '@/command-menu/components/CommandMenuContainer';
|
|
import { CommandMenuTopBar } from '@/command-menu/components/CommandMenuTopBar';
|
|
import { COMMAND_MENU_PAGES_CONFIG } from '@/command-menu/constants/CommandMenuPagesConfig';
|
|
import { commandMenuPageState } from '@/command-menu/states/commandMenuPageState';
|
|
import { useRecoilValue } from 'recoil';
|
|
import { isDefined } from 'twenty-ui';
|
|
|
|
export const CommandMenuRouter = () => {
|
|
const commandMenuPage = useRecoilValue(commandMenuPageState);
|
|
|
|
const commandMenuPageComponent = isDefined(commandMenuPage) ? (
|
|
COMMAND_MENU_PAGES_CONFIG.get(commandMenuPage)
|
|
) : (
|
|
<></>
|
|
);
|
|
|
|
return (
|
|
<CommandMenuContainer>
|
|
<CommandMenuTopBar />
|
|
{commandMenuPageComponent}
|
|
</CommandMenuContainer>
|
|
);
|
|
};
|