Files
movie-advisor/app/(site)/top/container.tsx
T
2024-03-19 20:15:42 +02:00

21 lines
545 B
TypeScript

'use client';
import List from '@/components/Movie/List';
import useTop from './useTop';
export default function Container() {
const { data: top, hasNextPage, fetchNextPage, isFetched } = useTop();
return (
<>
<List pages={top?.pages || []} fetchNextPage={fetchNextPage} hasNextPage={hasNextPage} />
{isFetched && !top?.pages?.[0]?.results?.length && (
<div className='h-40 w-full flex items-center justify-center text-xl text-muted-foreground'>
Nothing was found
</div>
)}
</>
);
}