import React from 'react'; import { Radio } from 'antd'; import { isFunction, isArray } from '../../utils'; const TitleView = (props: any) => { const { title, request, setState, doSearch, onTabChange, currentTab } = props; const tabIndex = currentTab || 0; const handleTabChange = (ev: any) => { const _tabIndex = ev.target.value; if (isFunction(onTabChange)) { return onTabChange(_tabIndex, ev); } setState({ tab: _tabIndex }); }; if (isArray(request) && request.length > 1) { return ( <> {request.map((item: any, index: any) => { return ( {item.name} ); })} {title &&
{title}
} ); } let content = title; if (isArray(request)) { content = request[0].name; } return
{content || ''}
; }; export default TitleView;