signal-desktop/ts/state/smart/CrashReportDialog.tsx
Jamie Kyle 27b55e472d
Refactor smart components
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
2024-03-13 13:44:13 -07:00

23 lines
869 B
TypeScript

// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { useSelector } from 'react-redux';
import React, { memo } from 'react';
import { CrashReportDialog } from '../../components/CrashReportDialog';
import { getIntl } from '../selectors/user';
import { useCrashReportsActions } from '../ducks/crashReports';
import { getCrashReportsIsPending } from '../selectors/crashReports';
export const SmartCrashReportDialog = memo(function SmartCrashReportDialog() {
const i18n = useSelector(getIntl);
const isPending = useSelector(getCrashReportsIsPending);
const { writeCrashReportsToLog, eraseCrashReports } =
useCrashReportsActions();
return (
<CrashReportDialog
i18n={i18n}
isPending={isPending}
writeCrashReportsToLog={writeCrashReportsToLog}
eraseCrashReports={eraseCrashReports}
/>
);
});