import React, { useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { Server, Globe, TestTube, Code, Wifi, Copy, Check, ExternalLink, Compass, Book, Briefcase, FileCode, HandCoins, Users, Wrench, MessageCircle, GitFork } from 'lucide-react'; // ... (interface and const arrays remain the same) ... interface ChainSpec { id: string; name: string; type: 'Live' | 'Development' | 'Local'; icon: React.ReactNode; endpoint: string; chainId: string; validators: number; features: string[]; color: string; } const chainSpecs: ChainSpec[] = [ { id: 'mainnet', name: 'PezkuwiChain Mainnet', type: 'Live', icon: , endpoint: 'wss://mainnet.pezkuwichain.io', chainId: '0x1234...abcd', validators: 100, features: ['Production', 'Real Tokenomics', 'Full Security'], color: 'from-purple-500 to-purple-600' }, { id: 'staging', name: 'PezkuwiChain Staging', type: 'Live', icon: , endpoint: 'wss://staging.pezkuwichain.io', chainId: '0x5678...efgh', validators: 20, features: ['Pre-production', 'Testing Features', 'Beta Access'], color: 'from-cyan-500 to-cyan-600' }, { id: 'testnet', name: 'Real Testnet', type: 'Live', icon: , endpoint: 'wss://testnet.pezkuwichain.io', chainId: '0x9abc...ijkl', validators: 8, features: ['Test Tokens', 'Full Features', 'Public Testing'], color: 'from-teal-500 to-teal-600' }, { id: 'beta', name: 'Beta Testnet', type: 'Live', icon: , endpoint: 'wss://beta.pezkuwichain.io', chainId: '0xdef0...mnop', validators: 4, features: ['Experimental', 'New Features', 'Limited Access'], color: 'from-orange-500 to-orange-600' }, { id: 'alfa', name: 'PezkuwiChain Alfa Testnet', type: 'Development', icon: , endpoint: 'ws://127.0.0.1:8844', chainId: 'pezkuwichain_alfa_testnet', validators: 4, features: ['4 Validators', 'Staking Active', 'Full Features'], color: 'from-purple-500 to-pink-600' }, { id: 'development', name: 'Development', type: 'Development', icon: , endpoint: 'ws://127.0.0.1:9944', chainId: '0xlocal...dev', validators: 1, features: ['Single Node', 'Fast Block Time', 'Dev Tools'], color: 'from-green-500 to-green-600' }, { id: 'local', name: 'Local Testnet', type: 'Local', icon: , endpoint: 'ws://127.0.0.1:9945', chainId: '0xlocal...test', validators: 2, features: ['Multi-node', 'Local Testing', 'Custom Config'], color: 'from-indigo-500 to-indigo-600' } ]; const subdomains = [ { name: 'Explorer', href: '/explorer', icon: , external: false }, { name: 'Docs', href: '/docs', icon: , external: false }, { name: 'Wallet', href: '/wallet', icon: , external: false }, { name: 'API', href: '/api', icon: , external: false }, { name: 'Faucet', href: '/faucet', icon: , external: false }, { name: 'Developers', href: '/developers', icon: , external: false }, { name: 'Grants', href: '/grants', icon: , external: false }, { name: 'Wiki', href: '/wiki', icon: , external: false }, { name: 'Forum', href: '/forum', icon: , external: false }, { name: 'Telemetry', href: '/telemetry', icon: , external: false }, ] const ChainSpecs: React.FC = () => { const { t } = useTranslation(); const [copiedId, setCopiedId] = useState(null); const [selectedSpec] = useState(chainSpecs[0]); const navigate = useNavigate(); const copyToClipboard = (text: string, id: string) => { navigator.clipboard.writeText(text); setCopiedId(id); setTimeout(() => setCopiedId(null), 2000); }; return (

{t('chainSpecs.title')}

{t('chainSpecs.subtitle')}

{chainSpecs.map((spec) => (
navigate(`/${spec.id}`)} className={`cursor-pointer p-4 rounded-xl border transition-all ${ selectedSpec.id === spec.id ? 'bg-gray-900 border-purple-500' : 'bg-gray-950/50 border-gray-800 hover:border-gray-700' }`} >
{spec.icon}
{spec.type}

{spec.name}

{spec.validators} validators
))} {/* Subdomains Box */}
navigate('/subdomains')} className="md:col-span-2 lg:col-span-1 cursor-pointer p-4 rounded-xl border transition-all bg-gray-950/50 border-gray-800 hover:border-gray-700" >
{t('chainSpecs.services')}

{t('chainSpecs.subdomainsTitle')}

{t('chainSpecs.availableServices', { count: subdomains.length })}
{/* Selected Chain Details */}

{selectedSpec.icon}
{selectedSpec.name}

{selectedSpec.endpoint}
{selectedSpec.chainId}

{t('chainSpecs.availableSubdomains')}

{subdomains.map(subdomain => (
navigate(subdomain.href)} className="flex items-center p-3 bg-gray-900 rounded-lg cursor-pointer hover:bg-gray-800 transition-colors">
{subdomain.icon}
{subdomain.name}
))}
); }; export default ChainSpecs;