--- import { Image } from "astro:assets"; import ProjectVideo from "./ProjectVideo.svelte"; import { cn } from "src/stylingUtils"; import type { ImageMetadata } from "astro"; type Props = { projects: Array<{ slug: string; data: { name: string; thumbnail: ImageMetadata; aspect?: string; video?: string; mainTags?: Array; }; }>; }; const { projects } = Astro.props; const videoImports = import.meta.glob("/src/assets/**/*.{mp4,webm}"); // Resolve all video URLs and create a map of paths to URLs const videoPaths = await Promise.all( Object.entries(videoImports).map(async ([path, importFn]) => { const module = await importFn(); // @ts-expect-error return { path, url: module.default }; }) ); // Convert the array of paths and URLs into an object for easy lookup const videos: Record = Object.fromEntries( videoPaths.map(({ path, url }) => [path, url]) ); console.log(videos); // This will log an object of paths mapped to URLs ---

things i've made

{ projects.map((project) => (
{project.data.video ? ( ) : null} {project.data.mainTags ? (
{project.data.mainTags.map((tag: string) => (
{tag}
))}
) : null}
{project.data.name}
)) }