// Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React, { useCallback, useRef } from 'react'; import type { MutableRefObject } from 'react'; import type { LocalizerType } from '../types/Util'; import { useConfirmDiscard } from '../hooks/useConfirmDiscard'; import { PreferencesContent } from './Preferences'; type PropsExternalType = { contentsRef: MutableRefObject; }; export type PropsDataType = { i18n: LocalizerType; }; // type PropsActionType = {}; export type PropsType = PropsDataType /* & PropsActionType */ & PropsExternalType; export function PreferencesDonations({ contentsRef, i18n, }: PropsType): JSX.Element { const tryClose = useRef<() => void | undefined>(); const [confirmDiscardModal, confirmDiscardIf] = useConfirmDiscard({ i18n, name: 'PreferencesDonations', tryClose, }); // TODO: only show back button when on a sub-page. // See ProfileEditor for its approach, an enum describing the current page // Note that we would want to then add that to nav/location stuff const backButton = (