import { useCartEnabled } from '@graphcommerce/magento-cart' import type { FabProps } from '@graphcommerce/next-ui' import { Fab, iconCheckmark, iconShoppingBag } from '@graphcommerce/next-ui' import { t } from '@lingui/core/macro' import type { SxProps, Theme } from '@mui/material' import type { UseAddProductsToCartActionProps } from './useAddProductsToCartAction' import { useAddProductsToCartAction } from './useAddProductsToCartAction' export type AddProductsToCartFabProps = { sx?: SxProps icon?: FabProps['icon'] } & Pick & UseAddProductsToCartActionProps export function AddProductsToCartFab(props: AddProductsToCartFabProps) { const { icon = iconShoppingBag, product, sku, ...rest } = props const { showSuccess, ...action } = useAddProductsToCartAction(props) const cartEnabled = useCartEnabled() if (!cartEnabled) return null return ( ) }