mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-09-28 16:09:49 +01:00
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
// Copyright 2021 Signal Messenger, LLC
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
import type { JSX } from 'react';
|
|
import type { LocalizerType } from '../types/Util.std.ts';
|
|
import { AxoConfirmDialog } from '../axo/AxoConfirmDialog.dom.tsx';
|
|
|
|
export type ConfirmDialogProps = {
|
|
i18n: LocalizerType;
|
|
title: string;
|
|
description: string;
|
|
cancelLabel?: string;
|
|
discardLabel?: string;
|
|
onClose: () => void;
|
|
onDiscard: () => void;
|
|
};
|
|
|
|
/** @deprecated */
|
|
export function ConfirmDiscardDialog({
|
|
i18n,
|
|
title,
|
|
description,
|
|
cancelLabel,
|
|
discardLabel,
|
|
onClose,
|
|
onDiscard,
|
|
}: ConfirmDialogProps): JSX.Element {
|
|
return (
|
|
<AxoConfirmDialog.Root
|
|
open
|
|
onOpenChange={onClose}
|
|
title={title}
|
|
// Deprecated: APIs should provide description
|
|
description={description ?? i18n('icu:ConfirmDiscardDialog--discard')}
|
|
>
|
|
<AxoConfirmDialog.Cancel>{cancelLabel}</AxoConfirmDialog.Cancel>
|
|
<AxoConfirmDialog.Action variant="strong-destructive" onClick={onDiscard}>
|
|
{discardLabel ?? i18n('icu:discard')}
|
|
</AxoConfirmDialog.Action>
|
|
</AxoConfirmDialog.Root>
|
|
);
|
|
}
|