terry-staging #8

Merged
terry merged 7 commits from terry-staging into main 2026-05-29 08:40:53 +00:00
Showing only changes of commit 4464e6fdc5 - Show all commits

View File

@@ -19,6 +19,7 @@ function AttachmentRow({ postId, att }: { postId: string; att: Attachment }) {
const { Icon, color } = fileIcon({ mime: att.mime, filename: att.filename }); const { Icon, color } = fileIcon({ mime: att.mime, filename: att.filename });
const displayFilename = filenameWithExtension(att.filename, att.mime); const displayFilename = filenameWithExtension(att.filename, att.mime);
const [isDownloading, setIsDownloading] = useState(false); const [isDownloading, setIsDownloading] = useState(false);
const [previewFailed, setPreviewFailed] = useState(false);
const handleDownload = async () => { const handleDownload = async () => {
if (isDownloading) return; if (isDownloading) return;
@@ -39,11 +40,12 @@ function AttachmentRow({ postId, att }: { postId: string; att: Attachment }) {
return ( return (
<div className="group flex h-[52px] items-center gap-3"> <div className="group flex h-[52px] items-center gap-3">
{previewUrl ? ( {previewUrl && !previewFailed ? (
<img <img
src={previewUrl} src={previewUrl}
alt={displayFilename} alt=""
loading="lazy" loading="lazy"
onError={() => setPreviewFailed(true)}
className="h-[52px] w-[52px] shrink-0 rounded-full object-cover" className="h-[52px] w-[52px] shrink-0 rounded-full object-cover"
/> />
) : ( ) : (