Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

1.1 KB
Raw Blame
import type { Meta, StoryObj } from '@storybook/react-vite';

import { storyMocks } from '@/storybook/controls/defineStoryMocks';
import type { PageStoryArgs } from '@/storybook/runtime/resolveStory';

import UnAuthorized from '../index';
import { unAuthorizedMocks } from './UnAuthorized.stories.mocks';

type UnAuthorizedArgs = PageStoryArgs<typeof unAuthorizedMocks>;

const pageStory = storyMocks(unAuthorizedMocks, { layout: 'app' });

/**
 * What a route the user's role cannot open shows.
 *
 * Route: `/un-authorized`.
 */
const meta = {
	title: 'Pages/System/Unauthorized',
	component: UnAuthorized,
	...pageStory,
	parameters: { ...pageStory.parameters },
} satisfies Meta<UnAuthorizedArgs>;

export default meta;

type Story = StoryObj<UnAuthorizedArgs>;

/** Where a route guard sends someone whose grant does not cover the page. */
export const Default: Story = {
	args: { access: 'viewer' },
};

/**
 * The same wall with no role derived at all, which is what a grant covering
 * nothing yields: the page offers support instead of an administrator.
 */
export const Anonymous: Story = {
	args: { access: 'deny-all' },
};