UNPKG

@automattic/wpcom-checkout

Version:
17 lines 938 B
import type { ResponseCart, ResponseCartMessage } from '@automattic/shopping-cart'; export type ShowMessages = (messages: ResponseCartMessage[]) => void; export default function useDisplayCartMessages({ cart, isLoadingCart, showErrorMessages, showSuccessMessages, shouldShowPersistentErrors, }: { cart: ResponseCart; isLoadingCart: boolean; showSuccessMessages: ShowMessages; showErrorMessages: ShowMessages; /** * Persistent errors like "Purchases are disabled for this site" are returned * during cart fetch (regular cart errors are transient and only are returned * when changing the cart). We want to display these errors only in certain * contexts where they will make sense (like checkout), not in every place * that happens to render this component (like the plans page). */ shouldShowPersistentErrors: boolean; }): void; //# sourceMappingURL=use-display-cart-messages.d.ts.map