import clsx from 'clsx' import type { ComponentProps } from 'react' import { FaSearch } from 'react-icons/fa' export interface SearchInputProps extends Omit, 'children'> { _container?: ComponentProps<'div'> value: string onClear: () => void } export const SearchInput = (props: SearchInputProps) => { const { _container, value, onClear, ...rest } = props return (
{/* search icon as label */} {/* main search input element */} {/* clear button, visible when search value exists */} {value.length > 0 && (
)}
) }