import VodsList, { VodsListHeading } from '@/app/components/vods-list'; import { getVtuberBySlug, getUrl } from '@/app/lib/vtubers'; import { IVodsResponse, getVodsForVtuber } from '@/app/lib/vods'; import Pager from '@/app/components/pager'; import { notFound } from 'next/navigation'; interface IPageParams { params: { slug: string; page: string; }; } export default async function Page({ params }: IPageParams) { let vtuber, vods; const pageNumber = parseInt(params.page); const pageSize = 24 try { vtuber = await getVtuberBySlug(params.slug); if (!vtuber) notFound(); vods = await getVodsForVtuber(vtuber.id, pageNumber, 24, true); } catch (error) { // Handle the error here (e.g., display an error message) console.error("An error occurred:", error); // You might also want to return an error page or message return
error
return ( <>