feat: add audio support in SharePage component

This commit is contained in:
ZareMate 2025-04-16 02:28:30 +02:00
parent caedd0ae88
commit 3048c00648
Signed by: zaremate
GPG Key ID: 369A0E45E03A81C3

View File

@ -63,6 +63,17 @@ export function SharePage({ fileId, fileType }: SharePageProps) {
</video>
);
}
if (fileType.startsWith("audio")) {
return (
<audio
controls
className="max-w-full max-h-96 rounded-lg shadow-md"
src={mediaSrc}
>
Your browser does not support the audio tag.
</audio>
);
}
return <img src={mediaSrc} alt="Media preview" className="max-w-full max-h-96 rounded-lg shadow-md" />;
}