2023-11-07 06:35:05 +03:00
import { Meta } from '@storybook/react' ;
2023-03-13 06:50:05 +03:00
import { ComponentError } from './ComponentError' ;
2023-11-07 06:35:05 +03:00
const meta = {
2023-03-13 06:50:05 +03:00
title : 'owncast/Components/Component Error' ,
component : ComponentError ,
parameters : {
docs : {
description : {
component : ` This component is used to display a user-facing fatal error within a component's error boundary. It enables a link to file a bug report. It should have enough detail to help the developers fix the issue, but not be so unapproachable it makes the user scared away. ` ,
} ,
} ,
} ,
2023-11-07 06:35:05 +03:00
} satisfies Meta < typeof ComponentError > ;
2023-03-13 06:50:05 +03:00
2023-11-07 06:35:05 +03:00
export default meta ;
2023-03-13 06:50:05 +03:00
2023-11-07 06:35:05 +03:00
export const DefaultMessage = {
args : {
componentName : 'Test Component' ,
} ,
2023-03-13 06:50:05 +03:00
} ;
2023-11-07 06:35:05 +03:00
export const Error1 = {
args : { message : 'This is a test error message.' , componentName : 'Test Component' } ,
} ;
2023-03-13 06:50:05 +03:00
2023-11-07 06:35:05 +03:00
export const WithDetails = {
args : {
message : 'This is a test error message.' ,
componentName : 'Test Component' ,
details : 'Here are some additional details about the error.' ,
} ,
2023-03-13 06:50:05 +03:00
} ;
2023-11-07 06:35:05 +03:00
export const CanRetry = {
args : {
message : 'This is a test error message.' ,
componentName : 'Test Component' ,
details : 'Here are some additional details about the error.' ,
retryFunction : ( ) = > {
console . log ( 'retrying' ) ;
} ,
2023-03-13 06:50:05 +03:00
} ,
} ;