signal-desktop/ts/components/ToastConversationArchived.tsx

37 lines
717 B
TypeScript
Raw Normal View History

2021-09-22 20:59:54 +00:00
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import type { LocalizerType } from '../types/Util';
2021-09-22 20:59:54 +00:00
import { Toast } from './Toast';
2021-10-06 21:00:51 +00:00
export type ToastPropsType = {
undo: () => unknown;
};
export type PropsType = {
2021-09-22 20:59:54 +00:00
i18n: LocalizerType;
onClose: () => unknown;
2021-10-06 21:00:51 +00:00
} & ToastPropsType;
2021-09-22 20:59:54 +00:00
export const ToastConversationArchived = ({
i18n,
onClose,
2021-10-06 21:00:51 +00:00
undo,
2021-09-22 20:59:54 +00:00
}: PropsType): JSX.Element => {
2021-10-06 21:00:51 +00:00
return (
<Toast
toastAction={{
label: i18n('conversationArchivedUndo'),
onClick: () => {
undo();
onClose();
},
}}
onClose={onClose}
>
{i18n('conversationArchived')}
</Toast>
);
2021-09-22 20:59:54 +00:00
};