@itwin/itwinui-react
Version:
A react component library for iTwinUI
62 lines (61 loc) • 2.1 kB
TypeScript
import * as React from 'react';
import type { PolymorphicForwardRefComponent } from '../../utils/index.js';
/** @deprecated Use `NonIdealState` instead. */
export type ErrorPageType = '300' | '301' | '302' | '303' | '304' | '305' | '307' | '308' | '401' | '403' | '404' | '408' | '500' | '502' | '503' | '504' | 'generic';
/** @deprecated Use `NonIdealState` instead. */
export type ErrorTypeTranslations = {
badGateway: string;
error: string;
forbidden: string;
internalServerError: string;
redirect?: string;
pageNotFound: string;
serviceUnavailable: string;
timedOut?: string;
unauthorized: string;
};
type ErrorPageProps = {
/**
* Type of error controls image and default text
*/
errorType: ErrorPageType;
/**
* Primary heading for the error page
*/
errorName?: string;
/**
* Secondary text to explain the error
* Can include html in order to provide a hyperlink
* E.g. `Please visit <a href="https://www.bentley.com/help">our support page</a> for help.`
*/
errorMessage?: React.ReactNode;
/**
* On click handler for primary button, if left out no primary button will be displayed
*/
primaryButtonHandle?: () => void;
/**
* Text for primary button, if left out no primary button will be displayed
*/
primaryButtonLabel?: string;
/**
* On click handler for secondary button, if left out no secondary button will be displayed
*/
secondaryButtonHandle?: () => void;
/**
* Text for secondary button, if left out no secondary button will be displayed
*/
secondaryButtonLabel?: string;
/**
* Used to translate default error messages, if no specific @errorName passed in
*/
translatedErrorMessages?: ErrorTypeTranslations;
};
/**
* @deprecated Use `NonIdealState` instead for a smaller client bundle.
*
* A stylized display to communicate common http errors.
* @example
* <ErrorPage errorType='401' />
*/
export declare const ErrorPage: PolymorphicForwardRefComponent<"div", ErrorPageProps>;
export {};