Files
Desktop/ts/components/Alert.dom.tsx
T
2026-03-30 11:54:59 -07:00

42 lines
854 B
TypeScript

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { ReactNode } from 'react';
import React from 'react';
import type { LocalizerType } from '../types/Util.std.ts';
import type { Theme } from '../util/theme.std.ts';
import { Button } from './Button.dom.tsx';
import { Modal } from './Modal.dom.tsx';
export type PropsType = {
body: ReactNode;
i18n: LocalizerType;
onClose: () => void;
theme?: Theme;
title?: string;
};
export function Alert({
body,
i18n,
onClose,
theme,
title,
}: PropsType): React.JSX.Element {
return (
<Modal
i18n={i18n}
modalFooter={
<Button onClick={onClose}>{i18n('icu:Confirmation--confirm')}</Button>
}
modalName="Alert"
onClose={onClose}
theme={theme}
title={title}
>
{body}
</Modal>
);
}