|
|
@ -45,6 +45,10 @@ const TvRecommendations: React.FC = () => {
|
|
|
|
|
|
|
|
|
|
|
|
const titles = data?.reduce((a, v) => [...a, ...v.results], [] as TvResult[]);
|
|
|
|
const titles = data?.reduce((a, v) => [...a, ...v.results], [] as TvResult[]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isEmpty = !isLoadingInitialData && titles?.length === 0;
|
|
|
|
|
|
|
|
const isReachingEnd =
|
|
|
|
|
|
|
|
isEmpty || (data && data[data.length - 1]?.results.length < 20);
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|
<div className="md:flex md:items-center md:justify-between mb-8 mt-6">
|
|
|
|
<div className="md:flex md:items-center md:justify-between mb-8 mt-6">
|
|
|
@ -56,7 +60,8 @@ const TvRecommendations: React.FC = () => {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<ListView
|
|
|
|
<ListView
|
|
|
|
items={titles}
|
|
|
|
items={titles}
|
|
|
|
isEmpty={!isLoadingInitialData && titles?.length === 0}
|
|
|
|
isEmpty={isEmpty}
|
|
|
|
|
|
|
|
isReachingEnd={isReachingEnd}
|
|
|
|
isLoading={
|
|
|
|
isLoading={
|
|
|
|
isLoadingInitialData || (isLoadingMore && (titles?.length ?? 0) > 0)
|
|
|
|
isLoadingInitialData || (isLoadingMore && (titles?.length ?? 0) > 0)
|
|
|
|
}
|
|
|
|
}
|
|
|
|