@talend/react-faceted-search
Version:
42 lines • 1.29 kB
JavaScript
import PropTypes from 'prop-types';
import { ButtonTertiary, SizedIcon, StackHorizontal } from '@talend/design-system';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
export const AddFacetPopoverRowButton = ({
id,
label,
onClick,
disabledLabel,
isCategory = false
}) => {
const body = /*#__PURE__*/_jsxs(StackHorizontal, {
gap: "0",
align: "center",
justify: "spaceBetween",
children: [/*#__PURE__*/_jsx("span", {
children: label
}), isCategory && /*#__PURE__*/_jsx("span", {
"data-test": "add-facet-popover-row-button-chevron",
"data-testid": "add-facet-popover-row-button-chevron",
children: /*#__PURE__*/_jsx(SizedIcon, {
name: "chevron-right",
size: "S"
})
})]
});
return /*#__PURE__*/_jsx(ButtonTertiary, {
"data-test": "add-facet-popover-row-button",
"data-testid": "add-facet-popover-row-button",
id: id,
onClick: onClick,
disabled: !!disabledLabel,
children: body
});
};
AddFacetPopoverRowButton.propTypes = {
id: PropTypes.string.isRequired,
label: PropTypes.string.isRequired,
onClick: PropTypes.func.isRequired,
disabledLabel: PropTypes.string,
isCategory: PropTypes.bool
};
//# sourceMappingURL=AddFacetPopoverRowButton.component.js.map