import React from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import { Icon, IconName, IconSize, Box } from '../../component-library'; import { BorderRadius, Color, Display, } from '../../../helpers/constants/design-system'; const TabBar = (props) => { const { tabs = [], onSelect, isActive } = props; return (
{tabs.map(({ key, content, icon }) => ( onSelect(key)} > {isActive(key, content) && ( )}
{icon}
{content}
))}
); }; TabBar.propTypes = { isActive: PropTypes.func.isRequired, tabs: PropTypes.array, onSelect: PropTypes.func, }; export default TabBar;