No access

A page the viewer may not open: who owns it, why it is closed and a way to request access.

Open full screen

Frame · Sidebar. <AppShell direction="frame">: the navigation on a grey tint; the page white and full-bleed.

npx wideset add block-no-access

Import the default export from @/blocks/wideset/no-access. The files below are relative to your project's source directory.

Installed with this block
  • app-shell
  • avatar
  • block-styles
  • breadcrumbs
  • button
  • dropdown-menu
  • form-field
  • list-item
  • sidebar
  • textarea
  • utils
blocks/wideset/no-access/index.tsx
'use client';

import '@/styles/wideset-blocks.css';

import { RiPieChart2Line } from '@remixicon/react';
import { AppShell } from '@/components/ui/wideset/app-shell/AppShell';
import { Breadcrumbs } from '@/components/ui/wideset/breadcrumbs/Breadcrumbs';

import { report, ROUTES } from './data';
import { RequestAccess } from './request-access';
import { AppSidebar } from './sidebar';

/**
 * No access (Frame direction): the viewer opened a page they may not see. The page keeps its
 * place, the breadcrumbs say what it is, and the closed state takes the body: who owns it, why it
 * is closed, a request with an optional message, and the way back.
 */
export default function NoAccess() {
  return (
    <AppShell className="ws-block-utility" direction="frame">
      <AppSidebar />
      <AppShell.Main className="flex flex-col">
        {/* The bar belongs to the surround: it runs edge to edge, the crumbs 20px from its edge. */}
        <div className="h-ws-18 border-ws-static-subtle px-ws-11 flex shrink-0 items-center border-b">
          <Breadcrumbs separator="arrow">
            <Breadcrumbs.Item asChild>
              <a href={ROUTES.reports}>
                <RiPieChart2Line aria-hidden="true" className="size-ws-9" />
                Reports
              </a>
            </Breadcrumbs.Item>
            <Breadcrumbs.Item>{report.name}</Breadcrumbs.Item>
          </Breadcrumbs>
        </div>

        {/* The state hangs from a fixed height above the middle, so it stays put when the form
            gives way to the sent state. */}
        <div className="px-ws-16 py-ws-28 ws-scrollbar flex min-h-0 flex-1 items-start justify-center overflow-y-auto">
          <RequestAccess />
        </div>
      </AppShell.Main>
    </AppShell>
  );
}