UNPKG

@zohodesk/components

Version:

In this Package, we Provide Some Basic Components to Build Web App

33 lines (31 loc) 952 B
import React from 'react'; import { TabContentWrapper_defaultProps } from "./props/defaultProps"; import { TabContentWrapper_propTypes } from "./props/propTypes"; import { Box } from "../Layout"; /* eslint-disable react/forbid-component-props */ const TabContentWrapper = _ref => { let { style, className, children, dataId, selectedTab, onScroll, dataSelectorId, tagName, a11y } = _ref; return /*#__PURE__*/React.createElement(Box, { flexible: true, style: style, dataId: dataId, className: className, onScroll: onScroll, dataSelectorId: dataSelectorId, tagName: tagName, ...a11y }, React.Children.map(children, child => /*#__PURE__*/React.isValidElement(child) && child.props.id === selectedTab ? child : null)); }; TabContentWrapper.defaultProps = TabContentWrapper_defaultProps; TabContentWrapper.propTypes = TabContentWrapper_propTypes; export default TabContentWrapper;