signal-desktop/ts/components/DialogRelink.tsx
2021-09-17 17:20:49 -05:00

35 lines
700 B
TypeScript

// Copyright 2020-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import { LocalizerType } from '../types/Util';
import { LeftPaneDialog } from './LeftPaneDialog';
export type PropsType = {
i18n: LocalizerType;
isRegistrationDone: boolean;
relinkDevice: () => void;
};
export const DialogRelink = ({
i18n,
isRegistrationDone,
relinkDevice,
}: PropsType): JSX.Element | null => {
if (isRegistrationDone) {
return null;
}
return (
<LeftPaneDialog
type="warning"
icon="relink"
clickLabel={i18n('unlinkedWarning')}
onClick={relinkDevice}
title={i18n('unlinked')}
hasAction
/>
);
};