@commercelayer/react-components
Version:
The Official Commerce Layer React Components
2 lines • 731 B
JavaScript
"use client";
;Object.defineProperty(exports,"__esModule",{value:!0}),exports.SubmitButton=SubmitButton;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),Parent_1=tslib_1.__importDefault(require("./utils/Parent")),isFunction_1=tslib_1.__importDefault(require("lodash/isFunction"));function SubmitButton(props){const{children,label="Submit"}=props,p=tslib_1.__rest(props,["children","label"]),parentProps=Object.assign(Object.assign({},p),{label});return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("button",Object.assign({type:"submit"},p,{children:(0,isFunction_1.default)(label)?label():label}))}exports.default=SubmitButton;