2021-03-03 20:09:58 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { FunctionComponent, ReactNode } from 'react';
|
|
|
|
import React from 'react';
|
2021-03-03 20:09:58 +00:00
|
|
|
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { LocalizerType } from '../types/Util';
|
2021-03-03 20:09:58 +00:00
|
|
|
import { Button } from './Button';
|
2021-04-13 14:20:02 +00:00
|
|
|
import { Modal } from './Modal';
|
2021-03-03 20:09:58 +00:00
|
|
|
|
|
|
|
type PropsType = {
|
|
|
|
title?: string;
|
2021-03-11 21:29:31 +00:00
|
|
|
body: ReactNode;
|
2021-03-03 20:09:58 +00:00
|
|
|
i18n: LocalizerType;
|
|
|
|
onClose: () => void;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const Alert: FunctionComponent<PropsType> = ({
|
|
|
|
body,
|
|
|
|
i18n,
|
|
|
|
onClose,
|
|
|
|
title,
|
|
|
|
}) => (
|
2021-04-13 14:20:02 +00:00
|
|
|
<Modal i18n={i18n} onClose={onClose} title={title}>
|
|
|
|
{body}
|
2021-05-27 15:43:39 +00:00
|
|
|
<Modal.ButtonFooter>
|
2021-04-13 14:20:02 +00:00
|
|
|
<Button onClick={onClose}>{i18n('Confirmation--confirm')}</Button>
|
2021-05-27 15:43:39 +00:00
|
|
|
</Modal.ButtonFooter>
|
2021-04-13 14:20:02 +00:00
|
|
|
</Modal>
|
2021-03-03 20:09:58 +00:00
|
|
|
);
|