import React from 'react'; import classnames from 'classnames'; import StyledWrapper from './StyledWrapper'; const RequestTabs = ({actions, dispatch, activeRequestTabId, requestTabs}) => { const getTabClassname = (tab) => { return classnames("request-tab select-none", { 'active': tab.id === activeRequestTabId }); }; const getMethodColor = (method) => { let color = ''; switch(method) { case 'GET': { color = 'rgb(5, 150, 105)'; break; } case 'POST': { color = '#8e44ad'; break; } } return color; }; const handleClick = (tab) => { dispatch({ type: actions.REQUEST_TAB_CLICK, requestTab: tab }); }; const handleCloseClick = (event, tab) => { event.stopPropagation(); event.preventDefault(); dispatch({ type: actions.REQUEST_TAB_CLOSE, requestTab: tab }); }; return ( {requestTabs && requestTabs.length ? ( ) : null} ); }; export default RequestTabs;