@commercelayer/react-components
Version:
The Official Commerce Layer React Components
29 lines (28 loc) • 1.01 kB
TypeScript
import { type JSX } from "react";
import type { ChildrenFunction } from "../../typings/index";
interface ChildrenProps extends Omit<Props, "children"> {
checkoutUrl: string;
href: string;
}
interface Props extends Omit<JSX.IntrinsicElements["a"], "children"> {
children?: ChildrenFunction<ChildrenProps>;
/**
* Label for the checkout link
*/
label?: string;
/**
* Ignores `order.checkout_url` and redirects to the hosted checkout micro-frontend.
* @default true
*/
hostedCheckout?: boolean;
}
/**
* This component generates a link to the hosted mfe-checkout application.
* In this way you can connect your shop application with our hosted micro-frontend.
*
* By default it will takes the customer to our hosted checkout micro-frontend,
* but if `hostedCheckout` is set as `false` it will use the `checkout_url` attribute
* found in the `order` object.
*/
export declare function CheckoutLink(props: Props): JSX.Element;
export default CheckoutLink;