import React, { useState } from 'react'; import { ApiUrlConsumer } from '../utils/contexts/'; import { PageStore } from '../utils/stores/'; import { useUser } from '../utils/hooks/'; import { addClassname } from '../utils/helpers/'; import { MediaListWrapper } from '../components/MediaListWrapper'; import { LazyLoadItemListAsync } from '../components/item-list/LazyLoadItemListAsync.jsx'; import { ProfileHistoryPage } from './ProfileHistoryPage'; import { Page } from './Page'; declare global { interface Window { MediaCMS: any; } } interface AnonymousHistoryPageProps { id?: string; title?: string; } export const AnonymousHistoryPage: React.FC = ({ id = 'history-media', title = PageStore.get('config-enabled').pages.history.title, }) => { const [resultsCount, setResultsCount] = useState(null); return ( {(apiUrl) => ( )} ); }; export const HistoryPage: React.FC = () => { const { username, isAnonymous } = useUser(); const anonymousPage = isAnonymous || !PageStore.get('config-options').pages.profile.includeHistory; if (!anonymousPage) { addClassname(document.getElementById('page-history'), 'profile-page-history'); window.MediaCMS.profileId = username; } return anonymousPage ? : ; };