aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/ErrorMessage.tsx
blob: 55e375977b3592b7c68f39ca45be1502790d542f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/** @jsx jsx */
import { jsx, css } from "@emotion/react";
import colors from "../colors";

interface ErrorMessageProps {
    show: boolean,
    message: string
}

const styles = css`
  color: ${colors.error};
  font-size: 18px;
  line-height: 15px;
  margin: 15px 0 0;
`;

export default function ErrorMessage(props: ErrorMessageProps): JSX.Element|null {
    if (!props.show) {
        return null;
    }

    return (
        <p css={styles}>{props.message}</p>
    );
}