import React, { useEffect, useCallback, useState } from 'react'; import PropTypes from 'prop-types'; import { withTranslation } from 'react-i18next'; import Page from './PageList/Page'; import { withUnstatedContainers } from './UnstatedUtils'; import AppContainer from '~/client/services/AppContainer'; import PageContainer from '~/client/services/PageContainer'; import { toastError } from '~/client/util/apiNotification'; import { useSWRxPageList } from '~/stores/page'; import PaginationWrapper from './PaginationWrapper'; const PageList = (props) => { const { appContainer, pageContainer, t } = props; const { path } = pageContainer.state; const [activePage, setActivePage] = useState(1); const { data: pagesListData, error } = useSWRxPageList(path, activePage); function setPageNumber(selectedPageNumber) { setActivePage(selectedPageNumber); } // TODO: To be implemented in #79549 if (error != null) { // toastError(error, 'Error occurred in PageList'); // eslint-disable-next-line no-console console.log(error, 'Error occurred in PageList'); } if (pagesListData == null) { return (
{t('custom_navigation.no_page_list')}
{t('custom_navigation.link_sharing_is_disabled')}