/*
* 获取扩展字段
* */
const getExtInfo = (item) => {
  const { componentExtInfo } = item;
  return componentExtInfo || {};
};

/*
* 获取服务列表
* */
const getServiceList = (item) => {
  const { serviceList } = item;
  return serviceList || [];
};

const getTabs = (item) => {
  const list = getServiceList(item);
  const { isShowKs = 'Y' } = getExtInfo(item);
  const tabs = [{
    title: '专家名医',
  }];
  if (isShowKs === 'Y' && list.length > 0) {
    tabs.push({ title: '科室介绍' });
  }
  return tabs;
};

export default {
  getTabs,
  getServiceList,
};
