import {
  BookOpen,
  BrainCircuit,
  Shield,
  Globe,
  Cpu,
  Layers,
  Wrench,
  Landmark,
  Network,
  Vote,
  WalletCards,
} from 'lucide-react';

// GitHub 配置
export const GITHUB_USERNAME = 'beihaili';
export const GITHUB_REPO = 'Get-Started-with-Web3';
export const GITHUB_BRANCH = 'main';

export const getRawBaseUrl = (path) =>
  `https://raw.githubusercontent.com/${GITHUB_USERNAME}/${GITHUB_REPO}/${GITHUB_BRANCH}/${path}/`;
export const getRawUrl = (path) =>
  `https://raw.githubusercontent.com/${GITHUB_USERNAME}/${GITHUB_REPO}/${GITHUB_BRANCH}/${path}`;

const FALLBACK = '# 正在加载内容...\n\n请稍候，如果长时间未加载请检查网络连接后刷新页面。';

// 课程数据配置
export const COURSE_DATA = [
  {
    id: 'module-1',
    title: 'Web3 快速入门',
    icon: BookOpen,
    color: 'from-blue-400 to-cyan-400',
    lessons: [
      {
        id: '1-1',
        title: '创建第一个 Web3 身份',
        path: 'Web3QuickStart/01_FirstWeb3Identity',
        fallbackContent: FALLBACK,
      },
      {
        id: '1-2',
        title: '体验第一笔交易',
        path: 'Web3QuickStart/02_FirstWeb3Transaction',
        fallbackContent: FALLBACK,
      },
      {
        id: '1-3',
        title: '体验第一个 DApp',
        path: 'Web3QuickStart/03_FirstWeb3Dapp',
        fallbackContent: FALLBACK,
      },
      {
        id: '1-4',
        title: '常用 Web3 网站',
        path: 'Web3QuickStart/04_UsefulWeb3Sites',
        fallbackContent: FALLBACK,
      },
      {
        id: '1-5',
        title: '发行你的第一个代币',
        path: 'Web3QuickStart/05_LaunchYourFirstToken',
        fallbackContent: FALLBACK,
      },
      {
        id: '1-6',
        title: 'Web3 安全基础',
        path: 'Web3QuickStart/06_Web3Security',
        fallbackContent: FALLBACK,
      },
      {
        id: '1-7',
        title: 'Web3 交易所入门',
        path: 'Web3QuickStart/07_Web3CEX',
        fallbackContent: FALLBACK,
      },
    ],
  },
  {
    id: 'module-2',
    title: '比特币技术 — 密码学与数据层',
    icon: Shield,
    color: 'from-orange-400 to-yellow-400',
    lessons: [
      {
        id: '2-1',
        title: '第01讲 密码学基础',
        path: 'GetStartedWithBitcoin/01_Cryptography',
        fallbackContent: FALLBACK,
      },
      {
        id: '2-2',
        title: '第02讲 比特币概览',
        path: 'GetStartedWithBitcoin/02_Overview',
        fallbackContent: FALLBACK,
      },
      {
        id: '2-3',
        title: '第03讲 比特币交易结构',
        path: 'GetStartedWithBitcoin/03_BitcoinTx',
        fallbackContent: FALLBACK,
      },
      {
        id: '2-4',
        title: '第04讲 多重签名 (MultiSig)',
        path: 'GetStartedWithBitcoin/04_MultiSig',
        fallbackContent: FALLBACK,
      },
      {
        id: '2-5',
        title: '第05讲 隔离见证 (SegWit)',
        path: 'GetStartedWithBitcoin/05_SegWit',
        fallbackContent: FALLBACK,
      },
      {
        id: '2-6',
        title: '第06讲 Taproot 升级详解',
        path: 'GetStartedWithBitcoin/06_Taproot',
        fallbackContent: FALLBACK,
      },
      {
        id: '2-7',
        title: '第07讲 高级交易应用',
        path: 'GetStartedWithBitcoin/07_AdvancedTransactions',
        fallbackContent: FALLBACK,
      },
      {
        id: '2-8',
        title: '第08讲 区块链数据结构',
        path: 'GetStartedWithBitcoin/08_DataStructure',
        fallbackContent: FALLBACK,
      },
    ],
  },
  {
    id: 'module-3',
    title: '比特币技术 — 网络与共识层',
    icon: Globe,
    color: 'from-green-400 to-emerald-400',
    lessons: [
      {
        id: '3-1',
        title: '第09讲 比特币核心节点',
        path: 'GetStartedWithBitcoin/09_BitcoinCore',
        fallbackContent: FALLBACK,
      },
      {
        id: '3-2',
        title: '第10讲 P2P 网络协议',
        path: 'GetStartedWithBitcoin/10_P2PProtocol',
        fallbackContent: FALLBACK,
      },
      {
        id: '3-3',
        title: '第11讲 网络安全',
        path: 'GetStartedWithBitcoin/11_NetworkSecurity',
        fallbackContent: FALLBACK,
      },
      {
        id: '3-4',
        title: '第12讲 工作量证明与挖矿',
        path: 'GetStartedWithBitcoin/12_ProofOfWork',
        fallbackContent: FALLBACK,
      },
      {
        id: '3-5',
        title: '第13讲 难度调整算法',
        path: 'GetStartedWithBitcoin/13_DifficultyAdjustment',
        fallbackContent: FALLBACK,
      },
      {
        id: '3-6',
        title: '第14讲 分叉机制与 BIP 流程',
        path: 'GetStartedWithBitcoin/14_ForksBIPs',
        fallbackContent: FALLBACK,
      },
    ],
  },
  {
    id: 'module-4',
    title: '比特币技术 — 应用层',
    icon: Cpu,
    color: 'from-purple-400 to-pink-400',
    lessons: [
      {
        id: '4-1',
        title: '第15讲 比特币钱包',
        path: 'GetStartedWithBitcoin/15_BitcoinWallet',
        fallbackContent: FALLBACK,
      },
      {
        id: '4-2',
        title: '第16讲 比特币 RPC 应用开发',
        path: 'GetStartedWithBitcoin/16_BitcoinRPC',
        fallbackContent: FALLBACK,
      },
      {
        id: '4-3',
        title: '第17讲 低费率广播工具',
        path: 'GetStartedWithBitcoin/17_BitcoinLowFeeBroadcast',
        fallbackContent: FALLBACK,
      },
      {
        id: '4-4',
        title: '第18讲 Bitcoin Script 脚本系统',
        path: 'GetStartedWithBitcoin/18_BitcoinScript',
        fallbackContent: FALLBACK,
      },
      {
        id: '4-5',
        title: '第19讲 比特币扩容与治理',
        path: 'GetStartedWithBitcoin/19_BitcoinGovernance',
        fallbackContent: FALLBACK,
      },
      {
        id: '4-6',
        title: '第20讲 Ordinals 与生态创新',
        path: 'GetStartedWithBitcoin/20_Ordinals',
        fallbackContent: FALLBACK,
      },
      {
        id: '4-7',
        title: '第21讲 DeFi 跨链',
        path: 'GetStartedWithBitcoin/21_DeFiCrossChain',
        fallbackContent: FALLBACK,
      },
    ],
  },
  {
    id: 'module-5',
    title: 'Web3 深度思考',
    icon: BrainCircuit,
    color: 'from-indigo-400 to-purple-400',
    lessons: [
      {
        id: '5-1',
        title: 'Web3 基本原则',
        path: 'Web3Thoughts/01_Principles',
        fallbackContent: FALLBACK,
      },
      {
        id: '5-2',
        title: '为什么区块链是必须的',
        path: 'Web3Thoughts/02_WhyBlockchainIsNecessary',
        fallbackContent: FALLBACK,
      },
      {
        id: '5-3',
        title: '比特币上最酷的交易',
        path: 'Web3Thoughts/03_TheCoolestTransactionOnBitcoin',
        fallbackContent: FALLBACK,
      },
    ],
  },
  {
    id: 'module-6',
    title: 'Web3 生态与实用工具',
    icon: Layers,
    color: 'from-teal-400 to-emerald-400',
    lessons: [
      {
        id: '6-1',
        title: 'DeFi 去中心化金融',
        path: '其它学习资源整理/DeFi',
        fallbackContent: FALLBACK,
      },
      {
        id: '6-2',
        title: '以太坊生态概览',
        path: '其它学习资源整理/Etherum',
        fallbackContent: FALLBACK,
      },
      {
        id: '6-3',
        title: 'Layer 2 扩容技术',
        path: '其它学习资源整理/Layer2',
        fallbackContent: FALLBACK,
      },
      {
        id: '6-4',
        title: '新兴公链生态 (Solana/Sui/Aptos)',
        path: '其它学习资源整理/新兴公链生态',
        fallbackContent: FALLBACK,
      },
      {
        id: '6-5',
        title: 'AI + Web3 融合',
        path: '其它学习资源整理/AI_Web3',
        fallbackContent: FALLBACK,
      },
      {
        id: '6-6',
        title: 'Web3 实用工具大全',
        path: '其它学习资源整理/实用工具',
        fallbackContent: FALLBACK,
      },
    ],
  },
  {
    id: 'module-7',
    title: 'Web3 Builder 实战',
    icon: Wrench,
    color: 'from-rose-400 to-orange-400',
    lessons: [
      {
        id: '7-1',
        title: '从零部署 ERC-20 代币',
        path: 'Web3BuilderLab/01_DeployERC20',
        labUrl: 'https://github.com/beihaili/web3-lab-deploy-token',
        fallbackContent: FALLBACK,
      },
      {
        id: '7-2',
        title: '构建你的第一个 DApp',
        path: 'Web3BuilderLab/02_BuildFirstDApp',
        labUrl: 'https://github.com/beihaili/web3-lab-first-dapp',
        fallbackContent: FALLBACK,
      },
      {
        id: '7-3',
        title: '如何阅读区块浏览器',
        path: 'Web3BuilderLab/03_ReadBlockExplorer',
        fallbackContent: FALLBACK,
      },
      {
        id: '7-4',
        title: '智能合约安全实战',
        path: 'Web3BuilderLab/04_SmartContractSecurity',
        fallbackContent: FALLBACK,
      },
    ],
  },
  {
    id: 'module-8',
    title: 'DeFi 深度解析',
    icon: Landmark,
    color: 'from-violet-400 to-purple-400',
    lessons: [
      {
        id: '8-1',
        title: 'DeFi 核心概念与架构',
        path: 'DeFiDeepDive/01_CoreConcepts',
        fallbackContent: FALLBACK,
      },
      {
        id: '8-2',
        title: 'AMM 与去中心化交易所',
        path: 'DeFiDeepDive/02_AMMAndDEX',
        fallbackContent: FALLBACK,
      },
      {
        id: '8-3',
        title: '借贷协议原理',
        path: 'DeFiDeepDive/03_LendingProtocols',
        fallbackContent: FALLBACK,
      },
      {
        id: '8-4',
        title: '稳定币全景',
        path: 'DeFiDeepDive/04_Stablecoins',
        fallbackContent: FALLBACK,
      },
      {
        id: '8-5',
        title: 'DeFi 风险与安全',
        path: 'DeFiDeepDive/05_DeFiRisks',
        fallbackContent: FALLBACK,
      },
    ],
  },
  {
    id: 'module-9',
    title: '跨链与 Layer 2 深度解析',
    icon: Network,
    color: 'from-pink-400 to-fuchsia-400',
    lessons: [
      {
        id: '9-1',
        title: '为什么需要扩容',
        path: 'L2CrossChain/01_WhyScaling',
        fallbackContent: FALLBACK,
      },
      {
        id: '9-2',
        title: 'Rollup 原理详解',
        path: 'L2CrossChain/02_RollupPrinciples',
        fallbackContent: FALLBACK,
      },
      {
        id: '9-3',
        title: '主流 L2 生态对比',
        path: 'L2CrossChain/03_L2Ecosystem',
        fallbackContent: FALLBACK,
      },
      {
        id: '9-4',
        title: '跨链桥与互操作性',
        path: 'L2CrossChain/04_CrossChainBridges',
        fallbackContent: FALLBACK,
      },
      {
        id: '9-5',
        title: 'L2 实操指南',
        path: 'L2CrossChain/05_L2PracticalGuide',
        fallbackContent: FALLBACK,
      },
    ],
  },
  {
    id: 'module-10',
    title: 'DAO 与去中心化治理',
    icon: Vote,
    color: 'from-amber-400 to-yellow-400',
    lessons: [
      {
        id: '10-1',
        title: 'DAO 是什么',
        path: 'DAOGovernance/01_WhatIsDAO',
        fallbackContent: FALLBACK,
      },
      {
        id: '10-2',
        title: '治理机制设计',
        path: 'DAOGovernance/02_GovernanceMechanisms',
        fallbackContent: FALLBACK,
      },
      {
        id: '10-3',
        title: 'DAO 工具生态',
        path: 'DAOGovernance/03_DAOTools',
        fallbackContent: FALLBACK,
      },
      {
        id: '10-4',
        title: '知名 DAO 案例分析',
        path: 'DAOGovernance/04_DAOCaseStudies',
        fallbackContent: FALLBACK,
      },
      {
        id: '10-5',
        title: 'DAO 的挑战与未来',
        path: 'DAOGovernance/05_DAOChallenges',
        fallbackContent: FALLBACK,
      },
    ],
  },
  {
    id: 'module-11',
    title: '以太坊与智能账户',
    icon: WalletCards,
    color: 'from-sky-400 to-blue-500',
    lessons: [
      {
        id: '11-1',
        title: 'Pectra 与 Fusaka 后的以太坊',
        path: 'EthereumSmartAccounts/01_EthereumAfterPectra',
        fallbackContent: FALLBACK,
      },
      {
        id: '11-2',
        title: '账户抽象与智能钱包',
        path: 'EthereumSmartAccounts/02_AccountAbstractionAndSmartWallets',
        fallbackContent: FALLBACK,
      },
    ],
  },
];
