import type { ReportLanguage } from '../types/analysis';

export const normalizeReportLanguage = (value?: string | null): ReportLanguage =>
  value === 'en' ? 'en' : 'zh';

const REPORT_TEXT = {
  zh: {
    keyInsights: '核心洞察',
    noAnalysisSummary: '暂无分析结论',
    actionAdvice: '操作建议',
    noAdvice: '暂无建议',
    trendPrediction: '趋势预测',
    noPrediction: '暂无预测',
    marketSentiment: '市场情绪',
    strategyPoints: '策略点位',
    sniperLevels: '狙击点位',
    idealBuy: '理想买入',
    secondaryBuy: '二次买入',
    stopLoss: '止损价位',
    takeProfit: '止盈目标',
    noValue: '—',
    newsFeed: '资讯动态',
    relatedNews: '相关资讯',
    refresh: '刷新',
    retry: '重试',
    dismiss: '关闭',
    details: '查看详情',
    loadingNews: '加载资讯中...',
    noNews: '暂无相关资讯',
    noNewsDescription: '可稍后刷新以获取最新资讯。',
    openLink: '跳转',
    transparency: '透明度',
    traceability: '数据追溯',
    rawResult: '原始分析结果',
    analysisSnapshot: '分析快照',
    copy: '复制',
    copied: '已复制',
    recordId: '记录 ID',
    fullReport: '完整分析报告',
    loadingReport: '加载报告中...',
    loadReportFailed: '加载报告失败',
    copyMarkdownSource: '复制 Markdown 源码',
    copyPlainText: '复制纯文本',
    analysisModel: '分析模型',
    fearGreedIndex: '恐惧贪婪指数',
    boardLinkage: '板块联动',
    relatedBoards: '关联板块',
    leadingBoard: '领涨',
    laggingBoard: '领跌',
    neutralBoard: '中性',
  },
  en: {
    keyInsights: 'KEY INSIGHTS',
    noAnalysisSummary: 'No analysis summary yet',
    actionAdvice: 'Action Advice',
    noAdvice: 'No advice yet',
    trendPrediction: 'Trend Outlook',
    noPrediction: 'No forecast yet',
    marketSentiment: 'Market Sentiment',
    strategyPoints: 'STRATEGY POINTS',
    sniperLevels: 'Action Levels',
    idealBuy: 'Ideal Entry',
    secondaryBuy: 'Secondary Entry',
    stopLoss: 'Stop Loss',
    takeProfit: 'Take Profit',
    noValue: '—',
    newsFeed: 'NEWS FEED',
    relatedNews: 'Related News',
    refresh: 'Refresh',
    retry: 'Retry',
    dismiss: 'Close',
    details: 'View details',
    loadingNews: 'Loading news...',
    noNews: 'No related news',
    noNewsDescription: 'Refresh later to check for the latest updates.',
    openLink: 'Open',
    transparency: 'TRANSPARENCY',
    traceability: 'Data Traceability',
    rawResult: 'Raw Analysis Result',
    analysisSnapshot: 'Analysis Snapshot',
    copy: 'Copy',
    copied: 'Copied!',
    recordId: 'Record ID',
    fullReport: 'Full Analysis Report',
    loadingReport: 'Loading report...',
    loadReportFailed: 'Failed to load report',
    copyMarkdownSource: 'Copy Markdown Source',
    copyPlainText: 'Copy Plain Text',
    analysisModel: 'Model',
    fearGreedIndex: 'Fear & Greed Index',
    boardLinkage: 'BOARD LINKAGE',
    relatedBoards: 'Related Boards',
    leadingBoard: 'Leading',
    laggingBoard: 'Lagging',
    neutralBoard: 'Neutral',
  },
} as const;

export const getReportText = (language?: string | null) => REPORT_TEXT[normalizeReportLanguage(language)];
