|
|
@ -162,16 +162,21 @@ function SelectMovieModalContent(props: SelectMovieModalContentProps) {
|
|
|
|
[allMovies, onMovieSelect]
|
|
|
|
[allMovies, onMovieSelect]
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
const items = useMemo(() => {
|
|
|
|
const sortedMovies = useMemo(
|
|
|
|
const sorted = [...allMovies].sort(sortByProp('sortTitle'));
|
|
|
|
() => [...allMovies].sort(sortByProp('sortTitle')),
|
|
|
|
|
|
|
|
[allMovies]
|
|
|
|
return sorted.filter(
|
|
|
|
);
|
|
|
|
(item) =>
|
|
|
|
|
|
|
|
item.title.toLowerCase().includes(filter.toLowerCase()) ||
|
|
|
|
const items = useMemo(
|
|
|
|
item.tmdbId.toString().includes(filter) ||
|
|
|
|
() =>
|
|
|
|
item.imdbId?.includes(filter)
|
|
|
|
sortedMovies.filter(
|
|
|
|
);
|
|
|
|
(item) =>
|
|
|
|
}, [allMovies, filter]);
|
|
|
|
item.title.toLowerCase().includes(filter.toLowerCase()) ||
|
|
|
|
|
|
|
|
item.tmdbId.toString().includes(filter) ||
|
|
|
|
|
|
|
|
item.imdbId?.includes(filter)
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
[sortedMovies, filter]
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<ModalContent onModalClose={onModalClose}>
|
|
|
|
<ModalContent onModalClose={onModalClose}>
|
|
|
|