2019-06-10 02:26:20 +00:00
|
|
|
import * as React from 'react';
|
|
|
|
|
2019-06-12 06:12:03 +00:00
|
|
|
export type FlashMessageType = 'success' | 'info' | 'warning' | 'error';
|
|
|
|
|
2019-06-10 02:26:20 +00:00
|
|
|
interface Props {
|
|
|
|
title?: string;
|
2019-06-12 06:12:03 +00:00
|
|
|
children: string;
|
|
|
|
type?: FlashMessageType;
|
2019-06-10 02:26:20 +00:00
|
|
|
}
|
|
|
|
|
2019-06-12 06:12:03 +00:00
|
|
|
export default ({ title, children, type }: Props) => (
|
2019-06-10 02:26:20 +00:00
|
|
|
<div className={`lg:inline-flex alert ${type}`} role={'alert'}>
|
|
|
|
{title && <span className={'title'}>{title}</span>}
|
2019-06-12 06:12:03 +00:00
|
|
|
<span className={'message'}>
|
|
|
|
{children}
|
|
|
|
</span>
|
2019-06-10 02:26:20 +00:00
|
|
|
</div>
|
|
|
|
);
|