Skip to main content

ErrorModal

Reference​

  • The ErrorModal component is designed to display error details in a modal dialog.
  • It provides a user-friendly way to show error information and allows users to dismiss the modal.

Props​

  1. state (required):
    • An object containing error details to be displayed.
    • Passed to the ErrorDetails component for rendering the error content.

Usage Example​

function Example(pageContext) {
const { protrakComponents } = React.useContext(customWidgetContext);
const { ErrorModal } = protrakComponents;

const errorState = { message: "An unexpected error occurred." };

return <ErrorModal state={errorState} />;
}
  • This will render an error modal displaying the error details and an "OK" button to close the modal.