import { type Meta, type StoryObj } from '@storybook/react-vite' import ErrorPage from './ErrorPage' import { DocsTemplate } from '../../../.storybook' const meta: Meta = { title: 'Components/ErrorPage', component: ErrorPage, parameters: { layout: 'fullscreen', docs: { page: () => ( The ErrorPage component provides a professional, full-screen error page layout for critical application failures, server errors, and other scenarios requiring user attention and support contact information. It creates a consistent, branded experience that helps maintain user trust during error situations.

The component is designed to be highly customizable while maintaining a consistent structure that includes company branding, clear error messaging, support contact information, and copyright details. It's particularly useful for 500 errors, application crashes, or maintenance pages. } infoBullets={[ Professional Layout: Full-screen design with structured sections for logo, error content, support information, and footer copyright. , Branded Experience: Prominently displays company logo to maintain brand consistency during error scenarios. , Support Integration: Built-in EmailLink sub-component for consistent support contact styling and easy mailto functionality. , Internationalization Ready: Uses translation service for default text content, supporting multiple languages and localization. , Flexible Messaging: Customizable title, message, and support text to handle various error types and severity levels. , Accessibility Focused: Proper heading structure and semantic HTML for screen readers and assistive technologies. , ]} /> ), }, }, argTypes: { logo: { description: 'Company or application logo element', control: false, }, icon: { description: 'Optional custom error icon (defaults to warning icon)', control: false, }, title: { description: 'Error page title text', control: 'text', }, message: { description: 'Main error description message', control: 'text', }, supportMessage: { description: 'Support contact information (use ErrorPage.EmailLink)', control: false, }, thankYouMessage: { description: 'Thank you message after support info', control: 'text', }, copyrightYear: { description: 'Copyright year (defaults to current year)', control: { type: 'number', min: 2020, max: 2030 }, }, copyrightName: { description: 'Copyright holder name', control: 'text', }, qaTestId: { description: 'Test identifier for QA automation', control: 'text', }, }, } export default meta type Story = StoryObj const SampleLogo = ( Pattern Logo ) export const Default: Story = { args: { logo: SampleLogo, title: 'Oops! Our server is currently down.', message: 'We apologize for the inconvenience and are working to resolve this issue.', supportMessage: ( <> Please try again later or contact{' '} if the problem persists. ), }, }