refactor: clean code and remove unnecessary dependencies

This commit is contained in:
ner committed 2024-09-30 18:54:13 +03:00
1 parent eceae6fec7
commit ebf599eed6
92 files changed
+1152 -2842

No files matched your search

+8 -5
View File
@@ -1,19 +1,22 @@
'use client';
import useFavorites from '@/app/(site)/favorites/useFavorites';
import List from '@/components/Movie/List';
import List from '@/components/List';
import useMounted from '@/hooks/useMounted';
import useFavorites from './useFavorites';
export default function Container() {
const { pages } = useFavorites();
const { shows } = useFavorites();
const isMounted = useMounted();
if (isMounted && !pages[0]?.results?.length)
if (!isMounted) return null;
if (!shows.length)
return (
<div className='h-40 w-full flex items-center text-center justify-center text-xl text-muted-foreground'>
There are no items in your favorites list
</div>
);
return <List pages={pages} />;
return <List shows={shows} />;
}