UNPKG

@shopgate/engage

Version:
33 lines (32 loc) 1.1 kB
import React from 'react'; import PropTypes from 'prop-types'; import { i18n } from "../../../core"; import { RadioGroupItem } from "../../../components"; import { radioItem, itemLabel } from "./FulfillmentPath.style"; /** * Renders a RadioItem element to be used by the FulfillmentPathSelector component. * This component is meant to be rendered as a child of a RadioGroup. * @param {Object} props The component props required by the RadioGroupItem component. * @param {React.ReactNode|null} [props.children=null] The child elements. * @param {string} props.name The name of the radio item. * @returns {JSX.Element} The rendered component. */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; export const FulfillmentPathItem = ({ name, children, ...rest }) => /*#__PURE__*/_jsx(RadioGroupItem, { ...rest, name: name, className: radioItem, label: /*#__PURE__*/_jsxs("div", { className: itemLabel, children: [/*#__PURE__*/_jsx("span", { children: i18n.text(name) }), children] }) }); FulfillmentPathItem.defaultProps = { children: null };