@commercelayer/react-components
Version:
The Official Commerce Layer React Components
48 lines (47 loc) • 1.38 kB
TypeScript
import { type MouseEvent, type ReactNode, type JSX } from 'react';
import type { ChildrenFunction } from '../../typings/index';
interface ChildrenProps extends Omit<Props, 'children'> {
/**
* The url of the cart
*/
href: string;
/**
* Callback to dispatch the click event
* @param e: MouseEvent<HTMLAnchorElement>
* @returns Promise<void>
*/
handleClick?: (e: MouseEvent<HTMLAnchorElement>) => Promise<void>;
/**
* The order id
*/
orderId?: string;
/**
* The access token
*/
accessToken?: string;
}
interface Props extends Omit<JSX.IntrinsicElements['a'], 'children'> {
children?: ChildrenFunction<ChildrenProps>;
/**
* Label to display
*/
label?: string | ReactNode;
/**
* The type of the cart. Defaults to undefined. If set to 'mini', the cart will open in a modal.
*/
type?: 'mini';
/**
* The domain of your forked application
*/
customDomain?: string;
}
/**
* This component generates a link to the hosted mfe-cart application.
* In this way you can connect your shop application with our hosted micro-frontend.
*
* <span title="Requirement" type="warning">
* Must be a child of the `<OrderContainer>` component. <br />
* </span>
*/
export declare function CartLink(props: Props): JSX.Element | null;
export default CartLink;