/**
 * Dropdown 预览 / 用法示例共用的抖音体服业务模拟数据
 */

const DROPDOWN_DEMO_ITEM_DEFS = [
  {
    value: 'douyin-community',
    id: 'douyin-community',
    label: '抖音社区',
    iconName: 'home-smile-stroked',
    desc: '体验与服务平台默认业务线，会话策略与知识库归属此入口',
  },
  {
    value: 'local-life-booking',
    id: 'local-life-booking',
    label: '抖音生活服务-商家预约到店与团购核销咨询超长业务线名称',
    iconName: 'building-02-stroked',
    desc: '切换当前会话归属业务线与处置策略模板',
  },
  {
    value: 'finish-archive',
    id: 'finish-archive',
    label: '完结并归档',
    iconName: 'folder-check-stroked',
    desc: '完结当前工单并同步归档至知识库案例',
  },
  {
    value: 'transfer-review',
    id: 'transfer-review',
    label: '转交二线复核',
    iconName: 'headphones-01-stroked',
    desc: '将会话转交二线专家继续跟进处置结论',
  },
];

export function buildDropdownDemoItems({ showDesc = false, showDisabledItem = false } = {}) {
  const descOn = showDesc === true || showDesc === 'true';

  return DROPDOWN_DEMO_ITEM_DEFS.map((item) => ({
    value: item.value,
    id: item.id,
    label: item.label,
    iconName: item.iconName,
    ...(descOn ? { desc: item.desc } : {}),
    ...(showDisabledItem ? { disabled: true } : {}),
  }));
}

export function getDropdownDemoDefaultSelected({ multiple = false, selectionIndicator = 'leading-check' } = {}) {
  if (multiple) return ['douyin-community', 'local-life-booking'];
  if (selectionIndicator === 'none') return null;
  return 'douyin-community';
}

export const DROPDOWN_DEMO_ITEMS_FOR_USAGE = DROPDOWN_DEMO_ITEM_DEFS.map(({ value, label, iconName }) => ({
  value,
  label,
  iconName,
}));
