2021-08-16 21:03:10 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2021-08-06 00:17:05 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { ConfirmationDialog } from './ConfirmationDialog';
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { LocalizerType } from '../types/Util';
|
2021-08-06 00:17:05 +00:00
|
|
|
|
|
|
|
export type PropsType = {
|
|
|
|
i18n: LocalizerType;
|
|
|
|
onClose: () => unknown;
|
|
|
|
onDiscard: () => unknown;
|
|
|
|
};
|
|
|
|
|
2022-11-18 00:45:19 +00:00
|
|
|
export function ConfirmDiscardDialog({
|
2021-08-06 00:17:05 +00:00
|
|
|
i18n,
|
|
|
|
onClose,
|
|
|
|
onDiscard,
|
2022-11-18 00:45:19 +00:00
|
|
|
}: PropsType): JSX.Element {
|
2021-08-06 00:17:05 +00:00
|
|
|
return (
|
|
|
|
<ConfirmationDialog
|
2022-09-27 20:24:21 +00:00
|
|
|
dialogName="ConfirmDiscardDialog"
|
2021-08-06 00:17:05 +00:00
|
|
|
actions={[
|
|
|
|
{
|
|
|
|
action: onDiscard,
|
|
|
|
text: i18n('discard'),
|
|
|
|
style: 'negative',
|
|
|
|
},
|
|
|
|
]}
|
|
|
|
i18n={i18n}
|
|
|
|
onClose={onClose}
|
|
|
|
>
|
|
|
|
{i18n('ConfirmDiscardDialog--discard')}
|
|
|
|
</ConfirmationDialog>
|
|
|
|
);
|
2022-11-18 00:45:19 +00:00
|
|
|
}
|