import * as React from 'react'; import { injectIntl, IntlShape } from 'react-intl'; import ClearBadge16 from '../../icon/fill/ClearBadge16'; import Search16 from '../../icon/fill/Search16'; import makeLoadable from '../loading-indicator/makeLoadable'; import messages from './messages'; export interface SearchActionsProps { /** Whether to render an interactive search button */ hasSubmitAction: boolean; /** Intl object */ intl: IntlShape; /** Called when clear button is clicked */ onClear: (event: React.SyntheticEvent) => void; } const SearchActions = ({ hasSubmitAction, intl, onClear }: SearchActionsProps) => { const { formatMessage } = intl; return (
{hasSubmitAction ? ( ) : (
)}
); }; export { SearchActions as SearchActionsBase }; export default makeLoadable(injectIntl(SearchActions));