import * as React from "react"; import { ErrorBoundary } from "../error_boundary"; export interface SearchFieldProps { onChange(searchTerm: string): void; onKeyPress?: (searchTerm: string) => void; searchTerm: string; placeholder: string; customLeftIcon?: React.ReactElement; customRightIcon?: React.ReactElement; autoFocus?: boolean; } export const SearchField = (props: SearchFieldProps) =>
{props.customLeftIcon || } props.onChange(e.currentTarget.value)} onKeyPress={e => props.onKeyPress?.(e.currentTarget.value)} placeholder={props.placeholder} /> {props.searchTerm && (props.customRightIcon || props.onChange("")} />)}
;