import { Component, ReactNode, RefObject } from "react"; import { FontLevel, Theme } from "@Component/Theme/Theme"; import { AllI18nKeys, Localization } from "@Component/Localization/Localization"; import "./TextField.scss"; interface ITextFieldProps { className?: string; keyI18n: AllI18nKeys; keyI18nOption?: Record; infoI18n?: AllI18nKeys; disableI18n?: AllI18nKeys; disableI18nOption?: Record; errorI18n?: AllI18nKeys; errorI18nOption?: Record; targetRef?: RefObject; customStyle?: boolean; customHoverStyle?: boolean; onClick?: () => any; } class TextField extends Component { private renderInput() { const classList: string[] = ["text-field-content"]; if (this.props.className) { classList.push(this.props.className); } if (!this.props.customStyle) { classList.push("text-field-content-styled"); } if (!this.props.customHoverStyle) { classList.push("text-field-content-hover-styled"); } if (this.props.errorI18n) { classList.push("text-field-content-error"); } return
{ this.props.children }
} private renderDisable() { return
} private renderError() { return
} public render(): ReactNode { return <>
{ this.props.disableI18n ? this.renderDisable() : this.renderInput() } { this.props.errorI18n ? this.renderError() : undefined }
} } export { TextField, ITextFieldProps };