2024-02-28 22:47:36 +03:00
|
|
|
import React, { type FC } from 'react';
|
2023-10-26 02:05:08 +03:00
|
|
|
import Box from '@mui/material/Box';
|
|
|
|
import { useGetGroupsUpcomingEpisodes } from 'hooks/useFetchItems';
|
|
|
|
import Loading from 'components/loading/LoadingComponent';
|
2024-08-14 13:31:34 -04:00
|
|
|
import globalize from 'lib/globalize';
|
2023-10-26 02:05:08 +03:00
|
|
|
import SectionContainer from './SectionContainer';
|
2024-02-28 22:47:36 +03:00
|
|
|
import { CardShape } from 'utils/card';
|
|
|
|
import type { LibraryViewProps } from 'types/library';
|
2023-10-26 02:05:08 +03:00
|
|
|
|
|
|
|
const UpcomingView: FC<LibraryViewProps> = ({ parentId }) => {
|
|
|
|
const { isLoading, data: groupsUpcomingEpisodes } = useGetGroupsUpcomingEpisodes(parentId);
|
|
|
|
|
|
|
|
if (isLoading) return <Loading />;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Box>
|
|
|
|
{!groupsUpcomingEpisodes?.length ? (
|
|
|
|
<div className='noItemsMessage centerMessage'>
|
|
|
|
<h1>{globalize.translate('MessageNothingHere')}</h1>
|
|
|
|
<p>
|
|
|
|
{globalize.translate(
|
|
|
|
'MessagePleaseEnsureInternetMetadata'
|
|
|
|
)}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
) : (
|
|
|
|
groupsUpcomingEpisodes?.map((group) => (
|
|
|
|
<SectionContainer
|
|
|
|
key={group.name}
|
|
|
|
sectionTitle={group.name}
|
|
|
|
items={group.items ?? []}
|
|
|
|
cardOptions={{
|
2024-02-28 22:47:36 +03:00
|
|
|
shape: CardShape.BackdropOverflow,
|
2023-10-26 02:05:08 +03:00
|
|
|
showLocationTypeIndicator: false,
|
|
|
|
showParentTitle: true,
|
|
|
|
preferThumb: true,
|
|
|
|
lazy: true,
|
|
|
|
showDetailsMenu: true,
|
|
|
|
missingIndicator: false,
|
|
|
|
cardLayout: false
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
))
|
|
|
|
)}
|
|
|
|
</Box>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default UpcomingView;
|