2019-01-17 02:27:43 -06:00
|
|
|
import React, { FC } from 'react';
|
2018-11-30 06:51:49 -06:00
|
|
|
|
|
|
|
interface Props {
|
|
|
|
message: any;
|
2019-04-01 00:38:00 -05:00
|
|
|
button?: {
|
|
|
|
text: string;
|
|
|
|
onClick: (event: React.MouseEvent) => void;
|
|
|
|
};
|
2018-11-30 06:51:49 -06:00
|
|
|
}
|
|
|
|
|
2019-01-17 02:27:43 -06:00
|
|
|
export const Alert: FC<Props> = props => {
|
2019-04-01 00:38:00 -05:00
|
|
|
const { message, button } = props;
|
2018-11-30 06:51:49 -06:00
|
|
|
return (
|
2019-04-01 00:38:00 -05:00
|
|
|
<div className="alert-container">
|
2018-11-30 06:51:49 -06:00
|
|
|
<div className="alert-error alert">
|
|
|
|
<div className="alert-icon">
|
|
|
|
<i className="fa fa-exclamation-triangle" />
|
|
|
|
</div>
|
|
|
|
<div className="alert-body">
|
|
|
|
<div className="alert-title">{message}</div>
|
|
|
|
</div>
|
2019-04-01 00:38:00 -05:00
|
|
|
{button && (
|
|
|
|
<div className="alert-button">
|
|
|
|
<button className="btn btn-outline-danger" onClick={button.onClick}>
|
|
|
|
{button.text}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
)}
|
2018-11-30 06:51:49 -06:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|