'use client';
import { useSearchParams } from 'next/navigation';
import List from '@/components/Movie/List';
import useSimilar from './useSimilar';
export default function Container() {
const params = useSearchParams();
const title = params.get('title');
const type = params.get('type');
const movieId = params.get('movieId') || undefined;
const { data: top, hasNextPage, fetchNextPage, isFetched } = useSimilar({ movieId, type: type as ShowType });
return (
<>
{Boolean(title) && (
Similar: {decodeURIComponent(title || '')}
)}
{isFetched && !top?.pages?.[0]?.results?.length && (