spotlight videos

This commit is contained in:
Martti Malmi
2023-12-06 16:53:52 +02:00
parent 199457b933
commit d20543d7a3
3 changed files with 30 additions and 2 deletions

View File

@ -30,7 +30,9 @@ function SpotlightFromThread({ onClose }: { onClose: () => void }) {
const thread = useContext(ThreadContext);
const parsed = thread.root ? transformTextCached(thread.root.id, thread.root.content, thread.root.tags) : [];
const images = parsed.filter(a => a.type === "media" && a.mimeType?.startsWith("image/"));
const images = parsed.filter(
a => a.type === "media" && (a.mimeType?.startsWith("image/") || a.mimeType?.startsWith("video/")),
);
if (images.length === 0) return;
return <SpotlightMedia images={images.map(a => a.content)} idx={0} onClose={onClose} />;
}