UNPKG

@carbon/react

Version:

React components for the Carbon Design System

34 lines (30 loc) 934 B
/** * Copyright IBM Corp. 2016, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js'; import React from 'react'; import cx from 'classnames'; import PropTypes from 'prop-types'; import { usePrefix } from '../../internal/usePrefix.js'; const SwitcherDivider = ({ className: customClassName, ...other }) => { const prefix = usePrefix(); const classNames = cx(`${prefix}--switcher__item--divider`, { [customClassName || '']: !!customClassName }); return /*#__PURE__*/React.createElement("hr", _extends({}, other, { className: classNames })); }; SwitcherDivider.propTypes = { /** * Optionally provide a custom class to apply to the underlying `<li>` node */ className: PropTypes.string }; export { SwitcherDivider as default };