import { Form, FormTextProps as BS5FormTextProps } from 'react-bootstrap' import MaterialIcon from '@/shared/components/material-icon' import classnames from 'classnames' import { MergeAndOverride } from '../../../../../types/utils' type TextType = 'default' | 'info' | 'success' | 'warning' | 'error' export type FormTextProps = MergeAndOverride< BS5FormTextProps, { type?: TextType marginless?: boolean } > const typeClassMap: Partial> = { error: 'text-danger', success: 'text-success', warning: 'text-warning', } export const getFormTextClass = (type?: TextType) => typeClassMap[type || 'default'] function FormTextIcon({ type }: { type?: TextType }) { switch (type) { case 'info': return case 'success': return case 'warning': return case 'error': return default: return null } } function FormText({ type = 'default', marginless, children, className, ...rest }: FormTextProps) { return ( {children} ) } export default FormText