function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

import React from 'react';
import { Box } from '../../primitives';
import { TabsContext } from './index';

const TabView = ({
  index,
  children,
  ...props
}) => {
  const {
    activeIndex
  } = React.useContext(TabsContext);

  const tabViewTemplate = () => {
    return activeIndex === index ? /*#__PURE__*/React.createElement(Box, _extends({
      p: 3
    }, props), children) : null;
  };

  return tabViewTemplate();
};

export default TabView;
//# sourceMappingURL=TabView.js.map