fp/services/next/app/components/vtuber-card.tsx

44 lines
1.8 KiB
TypeScript

import Link from "next/link";
import type { IVtuber } from '@futureporn/types';
import { getVodsForVtuber } from "@/app/lib/vods";
import Image from "next/legacy/image"
import NotFound from "@/app/vt/[slug]/not-found";
import ArchiveProgress from "./archive-progress";
export default async function VTuberCard(vtuber: IVtuber) {
const { id, slug, display_name, image_blur, image } = vtuber;
if (!image_blur) return <p>This VTuberCard is missing image_blur</p>
const vods = await getVodsForVtuber(id)
if (!vods) return <NotFound></NotFound>
return (
<Link
href={"/vt/"+slug}
className="column is-full-mobile is-half-tablet"
>
<div className="card">
<div className="card-content">
<div className="media">
<div className="media-left">
<figure className="image is-48x48">
<Image
className="is-rounded"
src={image}
alt={display_name}
objectFit="cover"
placeholder="blur"
blurDataURL={image_blur}
width={48}
height={48}
/>
</figure>
</div>
<div className="media-content">
<p className="title is-4 mb-3">{display_name}</p>
<ArchiveProgress vtuber={vtuber}/>
</div>
</div>
</div>
</div>
</Link>
)
}