import React from 'react'; import type { IPageInfoForEntity, IPageWithMeta } from '@growi/core'; import { LoadingSpinner } from '@growi/ui/dist/components'; import { useTranslation } from 'next-i18next'; import type { OnDeletedFunction, OnPutBackedFunction } from '~/interfaces/ui'; import type { ForceHideMenuItems } from '../Common/Dropdown/PageItemControl'; import { PageListItemL } from './PageListItemL'; import styles from './PageList.module.scss'; type Props = { pages: IPageWithMeta[], isEnableActions?: boolean, isReadOnlyUser: boolean, forceHideMenuItems?: ForceHideMenuItems, onPagesDeleted?: OnDeletedFunction, onPagePutBacked?: OnPutBackedFunction, } const PageList = (props: Props): JSX.Element => { const { t } = useTranslation(); const { pages, isEnableActions, isReadOnlyUser, forceHideMenuItems, onPagesDeleted, onPagePutBacked, } = props; if (pages == null) { return (
); } const pageList = pages.map(page => ( )); if (pageList.length === 0) { return (

{t('custom_navigation.no_pages_under_this_page')}

); } return (
    {pageList}
); }; export default PageList;