import { useState } from "preact/hooks"; export interface SearchBarProps { value: string; onChange: (value: string) => void; onSubmit: () => void; } export function SearchBar(props: SearchBarProps) { const { value, onChange, onSubmit } = props; return (
{ if(e.currentTarget){ onChange(e.currentTarget.value); } }} onKeyUp={e=>{ if(e.key === "Enter"){ onSubmit(); } }}/>
); }