mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-07-25 15:03:31 +00:00
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import React from 'react';
|
|
import { ApiUrlConsumer } from '../utils/contexts/';
|
|
import { PageStore } from '../utils/stores/';
|
|
import { MediaListWrapper } from '../components/MediaListWrapper';
|
|
import { LazyLoadItemListAsync } from '../components/item-list/LazyLoadItemListAsync.jsx';
|
|
import { Page } from './Page';
|
|
import { translateString } from '../utils/helpers/';
|
|
|
|
interface FeaturedMediaPageProps {
|
|
id?: string;
|
|
title?: string;
|
|
}
|
|
|
|
export const FeaturedMediaPage: React.FC<FeaturedMediaPageProps> = ({
|
|
id = 'featured-media',
|
|
title = translateString('Featured'),
|
|
}) => (
|
|
<Page id={id}>
|
|
<ApiUrlConsumer>
|
|
{(apiUrl) => (
|
|
<MediaListWrapper title={title} className="items-list-ver">
|
|
<LazyLoadItemListAsync
|
|
requestUrl={apiUrl.featured}
|
|
hideViews={!PageStore.get('config-media-item').displayViews}
|
|
hideAuthor={!PageStore.get('config-media-item').displayAuthor}
|
|
hideDate={!PageStore.get('config-media-item').displayPublishDate}
|
|
/>
|
|
</MediaListWrapper>
|
|
)}
|
|
</ApiUrlConsumer>
|
|
</Page>
|
|
);
|