import { type AttachmentHandle, downloadAndDecryptAttachment } from '@chat-app/shared/chat'; import { useEffect, useState } from 'react'; import { getCachedAttachment, putCachedAttachment } from '../lib/attachmentCache'; import { supabase } from '../lib/supabase'; import { AlertIcon, SpinnerIcon } from './icons'; interface Props { handle: AttachmentHandle; } // Decrypt the blob, render a native