'use strict';

var icons = require('@transferwise/icons');
var useListItemControl = require('../useListItemControl.js');
var PrimitiveButton = require('../../primitives/PrimitiveButton/PrimitiveButton.js');
require('../../primitives/PrimitiveAnchor/PrimitiveAnchor.js');
var React = require('react');
var ListItemContext = require('../ListItemContext.js');
var jsxRuntime = require('react/jsx-runtime');

const Navigation = function Navigation({
  href,
  ...props
}) {
  const {
    baseItemProps
  } = useListItemControl.useListItemControl('navigation', {
    href,
    ...props
  });
  const {
    ids,
    describedByIds
  } = React.useContext(ListItemContext.ListItemContext);
  const icon = /*#__PURE__*/jsxRuntime.jsx(icons.ChevronRight, {
    size: 16
  });
  return href ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
    children: icon
  }) : /*#__PURE__*/jsxRuntime.jsx(PrimitiveButton.default, {
    disabled: baseItemProps.disabled,
    "aria-describedby": describedByIds,
    id: ids.control,
    className: "btn-unstyled wds-list-item-control",
    onClick: props.onClick,
    children: icon
  });
};
Navigation.displayName = 'ListItem.Navigation';

exports.Navigation = Navigation;
//# sourceMappingURL=ListItemNavigation.js.map
