import React, { useState, KeyboardEvent, ChangeEvent } from "react"; import { MagnifyingGlass } from "@phosphor-icons/react"; interface SearchBarProps { query: string; setQuery: (query: string) => void; onSearch: () => void; } export const SearchBar: React.FC = ({ query, setQuery, onSearch, }) => { const handleChange = (event: ChangeEvent) => { const target = event.target; setQuery(target.value); // Resize the textarea to fit the content target.style.height = "24px"; const newHeight = target.scrollHeight; target.style.height = `${newHeight}px`; }; const handleKeyDown = (event: KeyboardEvent) => { if (event.key === "Enter" && !event.shiftKey) { onSearch(); event.preventDefault(); } }; return (