import { Fragment } from 'react' import { CommandModal, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandShortcut, CommandList, } from '@janhq/uikit' import { useAtom, useSetAtom } from 'jotai' import { MessageCircleIcon, SettingsIcon, LayoutGridIcon } from 'lucide-react' import { showCommandSearchModalAtom } from '@/containers/Providers/KeyListener' import ShortCut from '@/containers/Shortcut' import { MainViewState } from '@/constants/screens' import { mainViewStateAtom } from '@/helpers/atoms/App.atom' const menus = [ { name: 'Chat', icon: ( ), state: MainViewState.Thread, }, { name: 'Hub', icon: , state: MainViewState.Hub, }, { name: 'Settings', icon: , state: MainViewState.Settings, shortcut: , }, ] export default function CommandSearch() { const setMainViewState = useSetAtom(mainViewStateAtom) const [showCommandSearchModal, setShowCommandSearchModal] = useAtom( showCommandSearchModalAtom ) return ( {/* Temporary disable view search input until we have proper UI placement, but we keep function cmd + K for showing list page */} {/*
*/} No results found. {menus.map((menu, i) => { return ( { setMainViewState(menu.state) setShowCommandSearchModal(false) }} > {menu.icon} {menu.name} {menu.shortcut && ( {menu.shortcut} )} ) })}
) }