import * as React from 'react';
import { Link } from 'react-router-dom';
import type { PiletApi } from '<%- sourceName %>';

const Page = React.lazy(() => import('./Page'));

export function setup(app: PiletApi) {
  app.registerPage('/page', Page);

<% if (plugins.notifications) { -%>
  app.showNotification('Hello from Piral!', {
    autoClose: 2000,
  });
<% } -%>
<% if (plugins.menu) { -%>
  app.registerMenu(() => <Link to="/page">Page</Link>);
<% } -%>
<% if (plugins.dashboard) { -%>
  app.registerTile(() => <div>Welcome to Piral!</div>, {
    initialColumns: 2,
    initialRows: 2,
  });
<% } -%>
}
