Files
plainleaf/webapp/src/components/commandpalette.tsx
T
2022-02-22 14:18:37 +01:00

22 lines
421 B
TypeScript

import { AppCommand } from "../types";
import { FilterList } from "./filter";
export function CommandPalette({
commands,
onTrigger,
}: {
commands: AppCommand[];
onTrigger: (command: AppCommand) => void;
}) {
return (
<FilterList
placeholder="Enter command to run"
options={commands}
allowNew={false}
onSelect={(opt) => {
onTrigger(opt as AppCommand);
}}
/>
);
}