/* eslint-disable @next/next/no-img-element */ import Link from "next/link" import { notFound } from "next/navigation" import { cosmic } from "@/cosmic/client" import { TimeAgo } from "@/cosmic/elements/TimeAgo" import { CategoryPill, CategoryType } from "./CategoryPill" import { PlayArea } from "./PlayArea" import { VideoType } from "./VideoCard" export async function SingleVideo({ query, className, status, }: { query: any className?: string status?: "draft" | "published" | "any" }) { try { const { object: video }: { object: VideoType } = await cosmic.objects .findOne(query) .props("id,slug,title,metadata,created_at") .depth(1) .status(status ? status : "published") return (

{video.title}

{video.metadata.channel.title}
{video.metadata.channel.title}
{video.metadata.categories.map((category: CategoryType) => { return })}
) } catch (e: any) { if (e.status === 404) return notFound() } }