import React, { FC } from 'react'; import classNames from 'classnames'; import { StatusState } from '../../utils/input-statuses'; export type FormStatusIndicatorProps = { status: StatusState; }; export const FormStatusIndicator: FC = ({ status }) => { const { type, icon, message } = status || {}; const classes = classNames({ 'status-container': true, [`status-${type}`]: type, empty: !message, }); return ( {icon ? {icon} : null} {message ? {message} : null} ); }; export default FormStatusIndicator;