import {ShopActions} from '@shopify/shop-minis-platform/actions' import {useShopActions} from '../../internal/useShopActions' export interface UseErrorScreenReturns { /** * Show an error screen with the given error message. */ showErrorScreen: ShopActions['showErrorScreen'] } export const useErrorScreen = (): UseErrorScreenReturns => { const {showErrorScreen} = useShopActions() return {showErrorScreen} } /** * The `useErrorScreen` hook displays a full-screen blocking error UI. Use this for critical, unrecoverable errors that prevent users from continuing, such as missing required data or fatal API errors. The error screen takes over the entire Mini interface and typically requires user action to dismiss or retry. * * > Note: Use `useErrorScreen` for critical failures that block the user workflow (e.g., authentication failures, data corruption, network timeouts that prevent the app from functioning). This provides a full-screen error UI that the user must acknowledge. Use `useErrorToast` for recoverable errors or informational warnings (e.g., failed to save preference, temporary network issues). This shows a non-blocking notification that auto-dismisses and allows users to continue their current task. * @publicDocs */ export type UseErrorScreenGeneratedType = () => UseErrorScreenReturns