UNPKG

@gpa-gemstone/common-pages

Version:
35 lines (34 loc) 1.74 kB
import * as React from 'react'; import { CSSProperties } from 'styled-components'; interface IError { name: string; message: string; } interface IProps { /** * If provided, this message will be shown instead of the default error message. This is useful for providing a more user-friendly message or additional context about the error. NOTE: This will only be applied if ErrorContent is not provided, as ErrorContent is expected to provide its own error display. */ ErrorMessage?: string; /** * If provided, this content will be shown instead of the default error content. This is useful for providing a more customized error display. NOTE: This will take precedence over ErrorMessage and ErrorIconSize, as it is expected to provide its own error display. */ ErrorContent?: (props: IError) => React.ReactNode; /** * If provided, this style will be applied to the error container. This is useful for customizing the appearance of the error display. */ Style?: CSSProperties; /** * If provided, this class name will be applied to the error container. This is useful for applying custom styles to the error display. */ ClassName?: string; /** * If provided, this size will be applied to the error icon. This is useful for customizing the appearance of the error display. NOTE: This will only be applied if ErrorContent is not provided, as ErrorContent is expected to provide its own error display. */ ErrorIconSize?: number; } export default class ErrorBoundary extends React.Component<React.PropsWithChildren<IProps>, IError> { constructor(props: IProps); componentDidCatch(error: IError): void; render(): JSX.Element; } export {};