/**
 * 战略分析 Tab
 *
 * 包含：核心定位 + 战略分析 + 竞争地位分析（含行业排名弹窗）
 */

import React, { memo } from 'react';
import TabPanelContainer from '@components/TabPanelContainer';
import {
  CorePositioningCard,
  StrategyAnalysisCard,
  CompetitiveAnalysisCard,
} from '../components';
import type { ComprehensiveData, IndustryRankData } from '../types';

export interface StrategyTabProps {
  comprehensiveData?: ComprehensiveData;
  industryRankData?: IndustryRankData[];
  cardBg?: string;
}

const StrategyTab: React.FC<StrategyTabProps> = memo(({
  comprehensiveData,
  industryRankData,
  cardBg,
}) => {
  return (
    <TabPanelContainer showDisclaimer>
      {/* 核心定位卡片 */}
      {comprehensiveData?.qualitative_analysis && (
        <CorePositioningCard
          qualitativeAnalysis={comprehensiveData.qualitative_analysis}
          cardBg={cardBg}
        />
      )}

      {/* 战略分析 */}
      {comprehensiveData?.qualitative_analysis?.strategy && (
        <StrategyAnalysisCard
          strategy={comprehensiveData.qualitative_analysis.strategy}
          cardBg={cardBg}
        />
      )}

      {/* 竞争地位分析（包含行业排名弹窗） */}
      {comprehensiveData?.competitive_position && (
        <CompetitiveAnalysisCard
          comprehensiveData={comprehensiveData}
          industryRankData={industryRankData}
        />
      )}
    </TabPanelContainer>
  );
});

StrategyTab.displayName = 'StrategyTab';

export default StrategyTab;
