// Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React, { type ReactNode } from 'react'; import classNames from 'classnames'; import { SpinnerV2 } from '../SpinnerV2.js'; import type { AttachmentForUIType } from '../../types/Attachment.js'; import { missingCaseError } from '../../util/missingCaseError.js'; import { useAttachmentStatus } from '../../hooks/useAttachmentStatus.js'; export type PropsType = { attachment: AttachmentForUIType; isIncoming: boolean; children?: ReactNode; }; export function AttachmentStatusIcon({ attachment, isIncoming, children, }: PropsType): JSX.Element | null { const status = useAttachmentStatus(attachment); if (status.state === 'NeedsDownload') { return (