@atlaskit/atlassian-navigation
Version:
A horizontal navigation component for Atlassian products.
30 lines (29 loc) • 1.2 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["tooltip"];
import React, { forwardRef } from 'react';
import AppSwitcherIcon from '@atlaskit/icon/glyph/app-switcher';
import { IconButton } from '../IconButton';
/**
* _App switcher__
*
* An AppSwitcher button that can be passed into `AtlassianNavigation`'s
* `renderAppSwitcher` prop.
*
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#app-switcher)
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
*/
export var AppSwitcher = /*#__PURE__*/forwardRef(function (props, ref) {
var tooltip = props.tooltip,
iconButtonProps = _objectWithoutProperties(props, _excluded);
return /*#__PURE__*/React.createElement(IconButton, _extends({
icon: /*#__PURE__*/React.createElement(AppSwitcherIcon, {
label: typeof tooltip === 'string' ? tooltip : 'Appswitcher Icon'
}),
tooltip: tooltip,
ref: ref
}, iconButtonProps));
});
// exists only to extract props
// eslint-disable-next-line @repo/internal/react/use-noop
export default (function (props) {});