import { AllI18nKeys, I18N } from "@Component/Localization/Localization"; import { BackgroundLevel, FontLevel, Theme } from "@Component/Theme/Theme"; import { useSettingWithEvent, IMixinSettingProps } from "@Context/Setting"; import { Icon } from "@fluentui/react"; import { Component, ReactNode } from "react"; import "./SearchBox.scss"; interface ISearchBoxProps { value?: string; valueChange?: (value: string) => void; placeholderI18N?: AllI18nKeys; className?: string; } @useSettingWithEvent("language") class SearchBox extends Component { private renderCleanBox() { return
{ if (this.props.valueChange) { this.props.valueChange("") } }} >
; } public render(): ReactNode { return
{ if (e.target instanceof HTMLInputElement && this.props.valueChange) { this.props.valueChange(e.target.value) } }} />
{this.props.value ? this.renderCleanBox() : null}
} } export { SearchBox };