import React, { useState, useRef, useCallback } from 'react';
import { useHistory, useLocation } from 'react-router-dom';
const TabPanes = props => {
  const [activeKey, setActiveKey] = useState('');
  const [panes, setPanes] = useState([
    {
      title: '首页',
      key: 'home',
      closable: false,
      path: '/',
    },
  ]);

  const [isReload, setIsReload] = useState(false);
  const [selectedPanel, setSelectedPanel] = useState({});
  const pathRef = useRef(null);

  const {
    storeData: { curTab, reloadPath },
    setStoreData,
    defaultActiveKey,
    panesItem,
    tabActiveKey,
  } = props;

  const history = useHistory();
  const { pathnname, search } = useLocation();

  const fullPath = pathnname + search;

  const storeTabs = useCallback(
    ps => {
      const pathArr = ps.reduce((prev, next) => [...prev, next.path], []);
      // setStoreData('SET_CURTAB', pathArr)
    },
    [setStoreData],
  );

  const resetTabs = useCallback(() => {
    const initPanes = curTab.reduce((prev, next) => {});
  });
};
