import type { FC, ReactElement } from 'react' import { XMarkIcon } from '@heroicons/react/20/solid' import { MagnifyingGlassIcon } from '@heroicons/react/24/outline' import classNames from 'classnames' import { Loader } from '../index' import { DEFAULT_INPUT_NO_RINGS } from './index' export interface SearchProps { className?: string input?: (props: any) => ReactElement | null value: string loading: boolean onChange: (val: string) => void } export const Search: FC = ({ className, loading, input: Input, value, onChange }) => { return (
{Input ? ( ) : ( onChange(e.target.value)} placeholder="Search" value={value} /> )} {(loading || value) && (
{loading ? (
) : value ? (
onChange('')}>
) : <>}
)}
) }