import { useState } from "react"; import { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, } from "../ui/command"; import { Calculator, Calendar, CreditCard, Settings, Smile, User, } from "lucide-react"; import { DocumentPointer } from "@copilotkit/react-core"; export interface SourceSearchBoxProps { searchTerm: string; suggestedFiles: DocumentPointer[]; onSelectedFile: (filePointer: DocumentPointer) => void; } export function SourceSearchBox(props: SourceSearchBoxProps) { const [selectedValue, setSelectedValue] = useState(""); return ( { setSelectedValue(value); }} filter={(value, search) => { // if the search term is empty, show all commands if (props.searchTerm === "") return 1; // if the search term is a prefix of the command, show it if (value.startsWith(props.searchTerm)) return 1; // otherwise, don't show it return 0; }} > No results found. {props.suggestedFiles.map((filePointer) => { return ( { props.onSelectedFile(filePointer); }} >
{filePointer.sourceApplication} {filePointer.name}
); })}
{/* { console.log(value); console.log(value); }} > Calendar Search Emoji Calculator */}
); } export function Logo({ children, width, height, }: { children: React.ReactNode; width: string; height: string; }) { return (
{children}
); }