mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-25 04:36:46 +00:00
Rename files
This commit is contained in:
39
ts/components/ConfirmDiscardDialog.dom.tsx
Normal file
39
ts/components/ConfirmDiscardDialog.dom.tsx
Normal file
@@ -0,0 +1,39 @@
|
||||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
import { ConfirmationDialog } from './ConfirmationDialog.dom.js';
|
||||
import type { LocalizerType } from '../types/Util.std.js';
|
||||
|
||||
export type ConfirmDialogProps = {
|
||||
i18n: LocalizerType;
|
||||
bodyText?: string;
|
||||
discardText?: string;
|
||||
onClose: () => unknown;
|
||||
onDiscard: () => unknown;
|
||||
};
|
||||
|
||||
export function ConfirmDiscardDialog({
|
||||
i18n,
|
||||
bodyText,
|
||||
discardText,
|
||||
onClose,
|
||||
onDiscard,
|
||||
}: ConfirmDialogProps): JSX.Element {
|
||||
return (
|
||||
<ConfirmationDialog
|
||||
dialogName="ConfirmDiscardDialog"
|
||||
actions={[
|
||||
{
|
||||
action: onDiscard,
|
||||
text: discardText ?? i18n('icu:discard'),
|
||||
style: 'negative',
|
||||
},
|
||||
]}
|
||||
i18n={i18n}
|
||||
onClose={onClose}
|
||||
>
|
||||
{bodyText ?? i18n('icu:ConfirmDiscardDialog--discard')}
|
||||
</ConfirmationDialog>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user