import { dehydrate, HydrationBoundary } from '@tanstack/react-query'; import { Metadata } from 'next'; import Link from 'next/link'; import JsonLd from '@/components/JsonLd'; import randomQuery, { generatePage } from '@/data/queries/random'; import { SITE_URL, TITLE } from '@/env'; import getQueryClient from '@/lib/queryClient'; import { parseShowType } from '@/lib/showType'; import Container from './container'; interface SearchParams { type?: string; } export const metadata: Metadata = { alternates: { canonical: '/' } }; const Random = async ({ searchParams }: { searchParams: SearchParams }) => { const queryClient = getQueryClient(); const type = parseShowType(searchParams.type); const page = generatePage(type); await queryClient.prefetchInfiniteQuery(randomQuery({ page, type })); return (

{TITLE} — Discover Your Next Favorite Movie

Discover your next favorite movie

{TITLE} helps you decide what to watch: spin through random movie and series recommendations right on this page, browse the{' '} most popular movies {' '} everyone is talking about, or dive into the{' '} top-rated films {' '} of all time. Open any title to see its rating, overview, cast, and similar shows — and keep favorites and a watchlist so you never lose track of what to watch next.

); }; export const revalidate = 1; export default Random;