import { t, Trans } from "@lingui/macro" import { Box, Center, Kbd, TextInput } from "@mantine/core" import { openSpotlight, SpotlightAction, SpotlightProvider } from "@mantine/spotlight" import { redirectToFeed } from "app/slices/redirect" import { useAppDispatch } from "app/store" import { Subscription } from "app/types" import { FeedFavicon } from "components/content/FeedFavicon" import { useMousetrap } from "hooks/useMousetrap" import { TbSearch } from "react-icons/tb" export interface TreeSearchProps { feeds: Subscription[] } export function TreeSearch(props: TreeSearchProps) { const dispatch = useAppDispatch() const actions: SpotlightAction[] = props.feeds .sort((f1, f2) => f1.name.localeCompare(f2.name)) .map(f => ({ title: f.name, icon: , onTrigger: () => dispatch(redirectToFeed(f.id)), })) const searchIcon = const rightSection = (
Ctrl + K
) // additional keyboard shortcut used by commafeed v1 useMousetrap("g u", () => openSpotlight()) return ( Nothing found} > openSpotlight()} // prevent focus onFocus={e => e.target.blur()} readOnly /> ) }