/**
 * 结论标签组件
 * 用于显示最终筛选决策（纳入/排除/不确定）
 */

import { Tag } from 'antd';
import {
  CheckCircleOutlined,
  CloseCircleOutlined,
  QuestionCircleOutlined,
} from '@ant-design/icons';
import type { ConclusionType } from '../types';

interface ConclusionTagProps {
  conclusion: ConclusionType;
  showIcon?: boolean;
  size?: 'small' | 'middle' | 'large';
}

const ConclusionTag: React.FC<ConclusionTagProps> = ({
  conclusion,
  showIcon = true,
  size = 'middle',
}) => {
  const getConfig = () => {
    switch (conclusion) {
      case 'include':
        return {
          color: 'success',
          icon: <CheckCircleOutlined />,
          text: '纳入',
        };
      case 'exclude':
        return {
          color: 'default',
          icon: <CloseCircleOutlined />,
          text: '排除',
        };
      case 'uncertain':
        return {
          color: 'warning',
          icon: <QuestionCircleOutlined />,
          text: '不确定',
        };
      default:
        return {
          color: 'default',
          icon: <QuestionCircleOutlined />,
          text: '未处理',
        };
    }
  };

  const config = getConfig();

  const fontSize = size === 'large' ? 'text-base' : size === 'small' ? 'text-xs' : 'text-sm';

  return (
    <Tag
      color={config.color}
      icon={showIcon ? config.icon : undefined}
      className={`m-0 font-semibold ${fontSize}`}
    >
      {config.text}
    </Tag>
  );
};

export default ConclusionTag;





