UNPKG

@commercelayer/react-components

Version:
2 lines 591 B
"use client"; import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import Parent from"../utils/Parent";import CustomerPaymentSourceContext from"../../context/CustomerPaymentSourceContext";export function PaymentSourceDeleteButton({children,label="Delete",...props}){const{handleDeleteClick}=useContext(CustomerPaymentSourceContext),parentProps={label,handleDeleteClick,...props};return children?_jsx(Parent,{...parentProps,children}):handleDeleteClick!=null?_jsx("button",{...props,onClick:handleDeleteClick,children:label}):null}export default PaymentSourceDeleteButton;