import { IconArrowLeft } from 'ui/src/components/Icon/icons/IconArrowLeft' import { BadgeExperimental } from './Command.Badges' import { COMMAND_ROUTES } from './Command.constants' import { CommandShortcut } from './Command.utils' import { useCommandMenu } from './CommandMenuProvider' export default function CommandMenuShortcuts() { const { setPages, pages, currentPage } = useCommandMenu() return (
setPages([])}>
{pages.map((page, index) => ( { if (index === pages.length - 1) { return } setPages(pages.slice(0, index - 1)) }} > {page} ))} {currentPage && isExperimental(currentPage) && }
) } /** * TODO: remove this function and store this info on each page * Temporary function to determine whether or not to show 'Experimental' badge */ function isExperimental(page: string) { switch (page) { case COMMAND_ROUTES.AI: case COMMAND_ROUTES.GENERATE_SQL: return true default: return false } }