UNPKG

strapi-plugin-masterclass

Version:
24 lines (23 loc) 1.12 kB
"use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); const jsxRuntime = require("react/jsx-runtime"); const admin = require("@strapi/strapi/admin"); const reactRouterDom = require("react-router-dom"); const designSystem = require("@strapi/design-system"); const reactIntl = require("react-intl"); const index = require("./index-BAP9EoKH.js"); const getTranslation = (id) => `${index.PLUGIN_ID}.${id}`; const HomePage = () => { const { formatMessage } = reactIntl.useIntl(); return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Main, { children: /* @__PURE__ */ jsxRuntime.jsxs("h1", { children: [ "Welcome to ", formatMessage({ id: getTranslation("plugin.name") }) ] }) }); }; const App = () => { return /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Routes, { children: [ /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: /* @__PURE__ */ jsxRuntime.jsx(HomePage, {}) }), /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: "*", element: /* @__PURE__ */ jsxRuntime.jsx(admin.Page.Error, {}) }) ] }); }; exports.App = App;