diff --git a/src/App.tsx b/src/App.tsx index 954b8f7..40fea4f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -6,7 +6,6 @@ import { useDebouncedValue } from './hooks/useDebouncedValue'; import { type SortOption } from './utils/sortAndFilterMovies'; import { useSessionStorage } from './hooks/useSessionStorage'; -import { SortFilterBar } from './components/SortFilterBar'; import { useFavorites } from './hooks/useFavorites'; import { MovieDetails } from './components/MovieDetails'; import { FavoritesLayout } from './layout/FavoritesLayout'; @@ -59,17 +58,14 @@ function App() { />
- + {isSearching ? ( ) : ( boolean; toggleFavorite: (id: number) => void; onSelectMovie: (movie: Movie) => void; @@ -18,14 +13,12 @@ type FavoritesLayoutProps = { export function FavoritesLayout({ favoriteIds, - sortBy, - minRating, isFavorite, toggleFavorite, onSelectMovie, }: FavoritesLayoutProps) { const { movies, isLoading, error } = useFavoriteMovies(favoriteIds); - const filteredMovies = sortAndFilterMovies(movies, sortBy, minRating); + return (
- {filteredMovies.length > 0 ? ( + {movies.length > 0 ? ( boolean; toggleFavorite: (id: number) => void; onSelectMovie: (movie: Movie) => void; @@ -20,8 +15,6 @@ type MainLayoutProps = { // HomeSections.tsx export function MainLayout({ - sortBy, - minRating, isFavorite, toggleFavorite, onSelectMovie, @@ -53,7 +46,7 @@ export function MainLayout({ > {popular.data && ( {current.data && ( ; // or whatever your hook returns sortBy: SortOption; minRating: number; + onSortChange: (value: SortOption) => void; + onMinRatingChange: (value: number) => void; isFavorite: (id: number) => boolean; toggleFavorite: (id: number) => void; onSelectMovie: (movie: Movie) => void; @@ -21,26 +24,36 @@ export function SearchLayout({ query, search, sortBy, + onSortChange, minRating, + onMinRatingChange, isFavorite, toggleFavorite, onSelectMovie, }: SearchSectionProps) { return ( -
- {search.data && ( - - )} -
+ <> + +
+ {search.data && ( + + )} +
+ ); }