import styled from '@emotion/styled'; import { css } from '@emotion/react'; import { valencia } from 'styles/colors'; import { getThemeFont, fontSize } from 'styles/fonts'; import WarningIcon from 'components/Icon/icons/alert/warning'; import { ReactNode } from 'react'; const Container = styled.div` display: flex; margin-top: 0.3em; margin-bottom: 0.3em; line-height: 1.4; ${({ theme: { rtl } }) => rtl && css` direction: rtl; `}; `; const Text = styled.span` flex-grow: 1; width: 0; margin-top: 3px; color: ${valencia.main}; font-family: ${getThemeFont}; font-size: ${fontSize.small}; `; const IconWrapper = styled.span` ${({ theme: { rtl } }) => !rtl && css` margin-left: 1em; `} `; interface Props { error?: ReactNode; [rest: string]: any; } const ErrorMessage = ({ error = '', ...rest }: Props) => error ? ( {error} ) : null; export default ErrorMessage;