// Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React, { useCallback, useState, ReactElement } from 'react'; import { ConversationType } from '../../state/ducks/conversations'; import { LocalizerType } from '../../types/Util'; import { Intl } from '../Intl'; import { Emojify } from './Emojify'; import { DeliveryIssueDialog } from './DeliveryIssueDialog'; export type PropsDataType = { sender?: ConversationType; }; type PropsHousekeepingType = { i18n: LocalizerType; }; export type PropsType = PropsDataType & PropsHousekeepingType; export function DeliveryIssueNotification( props: PropsType ): ReactElement | null { const { i18n, sender } = props; const [isDialogOpen, setIsDialogOpen] = useState(false); const openDialog = useCallback(() => { setIsDialogOpen(true); }, [setIsDialogOpen]); const closeDialog = useCallback(() => { setIsDialogOpen(false); }, [setIsDialogOpen]); if (!sender) { return null; } return (
, }} i18n={i18n} />
{isDialogOpen ? ( ) : null}
); }