2022-08-06 01:36:13 +03:00
|
|
|
|
2022-08-21 03:09:22 +03:00
|
|
|
import React, { FunctionComponent, useCallback } from 'react';
|
2022-08-06 01:36:13 +03:00
|
|
|
|
|
|
|
import globalize from '../../scripts/globalize';
|
2022-08-21 03:09:22 +03:00
|
|
|
import ViewItemsContainer from '../components/ViewItemsContainer';
|
2022-08-06 01:36:13 +03:00
|
|
|
|
|
|
|
type IProps = {
|
|
|
|
topParentId: string | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
const TrailersView: FunctionComponent<IProps> = ({ topParentId }: IProps) => {
|
2022-08-21 03:09:22 +03:00
|
|
|
const getBasekey = useCallback(() => {
|
|
|
|
return 'trailers';
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
const getFilterMode = useCallback(() => {
|
|
|
|
return 'movies';
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
const getItemTypes = useCallback(() => {
|
|
|
|
return 'Trailer';
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
const getNoItemsMessage = useCallback(() => {
|
|
|
|
return 'MessageNoTrailersFound';
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
const getSortMenuOptions = useCallback(() => {
|
|
|
|
return [{
|
|
|
|
name: globalize.translate('Name'),
|
|
|
|
id: 'SortName'
|
|
|
|
}, {
|
|
|
|
name: globalize.translate('OptionImdbRating'),
|
|
|
|
id: 'CommunityRating,SortName'
|
|
|
|
}, {
|
|
|
|
name: globalize.translate('OptionDateAdded'),
|
|
|
|
id: 'DateCreated,SortName'
|
|
|
|
}, {
|
|
|
|
name: globalize.translate('OptionDatePlayed'),
|
|
|
|
id: 'DatePlayed,SortName'
|
|
|
|
}, {
|
|
|
|
name: globalize.translate('OptionParentalRating'),
|
|
|
|
id: 'OfficialRating,SortName'
|
|
|
|
}, {
|
|
|
|
name: globalize.translate('OptionPlayCount'),
|
|
|
|
id: 'PlayCount,SortName'
|
|
|
|
}, {
|
|
|
|
name: globalize.translate('OptionReleaseDate'),
|
|
|
|
id: 'PremiereDate,SortName'
|
|
|
|
}];
|
|
|
|
}, []);
|
2022-08-06 01:36:13 +03:00
|
|
|
|
|
|
|
return (
|
2022-08-21 03:09:22 +03:00
|
|
|
<ViewItemsContainer
|
|
|
|
topParentId={topParentId}
|
|
|
|
getBasekey={getBasekey}
|
|
|
|
getFilterMode={getFilterMode}
|
|
|
|
getItemTypes={getItemTypes}
|
|
|
|
getSortMenuOptions={getSortMenuOptions}
|
|
|
|
getNoItemsMessage={getNoItemsMessage}
|
|
|
|
/>
|
2022-08-06 01:36:13 +03:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default TrailersView;
|