PHP 8.2.30
Preview: page.js Size: 1.71 KB
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/lib/frontend/components/routes/page.js

import { InfoBox, Text } from '@adminjs/design-system';
import React, { useMemo } from 'react';
import { Trans } from 'react-i18next';
import { useSelector } from 'react-redux';
import { useParams } from 'react-router';
import allowOverride from '../../hoc/allow-override.js';
import withNoSSR from '../../hoc/with-no-ssr.js';
import { useTranslation } from '../../hooks/index.js';
import ErrorBoundary from '../app/error-boundary.js';
const Page = () => {
  const pages = useSelector(state => state.pages);
  const params = useParams();
  const {
    pageName
  } = params;
  const {
    tm
  } = useTranslation();
  const currentPage = useMemo(() => pages.find(({
    name
  }) => name === pageName), [pages, pageName]);
  if (!currentPage) {
    return /*#__PURE__*/React.createElement(InfoBox, {
      title: tm('pageNotFound_title'),
      illustration: "NotFound"
    }, /*#__PURE__*/React.createElement(Text, {
      mb: "xxl"
    }, /*#__PURE__*/React.createElement(Trans, {
      i18nKey: "messages.pageNotFound_subtitle",
      values: {
        pageName
      },
      components: {
        strong: /*#__PURE__*/React.createElement("strong", null)
      }
    })));
  }
  const Component = AdminJS.UserComponents[currentPage.component];
  if (!Component) {
    return /*#__PURE__*/React.createElement(InfoBox, {
      title: tm('componentNotFound_title'),
      illustration: "Beware"
    }, /*#__PURE__*/React.createElement(Text, {
      mb: "xxl"
    }, /*#__PURE__*/React.createElement(Trans, {
      i18nKey: "messages.componentNotFound_subtitle"
    })));
  }
  return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(Component, null));
};
export default allowOverride(withNoSSR(Page), 'PageRoute');

Directory Contents

Dirs: 1 × Files: 8

Name Size Perms Modified Actions
utils DIR
- drwxr-xr-x 2026-02-28 00:31:52
Edit Download
4.65 KB lrw-r--r-- 2026-02-28 00:31:24
Edit Download
1.05 KB lrw-r--r-- 2026-02-28 00:31:26
Edit Download
368 B lrw-r--r-- 2026-02-28 00:31:44
Edit Download
1.71 KB lrw-r--r-- 2026-02-28 00:31:48
Edit Download
5.83 KB lrw-r--r-- 2026-02-28 00:31:48
Edit Download
2.02 KB lrw-r--r-- 2026-02-28 00:31:48
Edit Download
3.58 KB lrw-r--r-- 2026-02-28 00:31:48
Edit Download
3.11 KB lrw-r--r-- 2026-02-28 00:31:48
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).