'use client'; import { YieldPool } from '@/types'; import { SecurityScore } from './SecurityScore'; import { formatNumber, formatPercent } from '@/utils/security'; import { ExternalLink, TrendingUp, Shield, Clock } from 'lucide-react'; interface TopPoolCardProps { pool: YieldPool; rank: number; } export function TopPoolCard({ pool, rank }: TopPoolCardProps) { // Médailles emoji const medals: Record = { 1: '🥇', 2: '🥈', 3: '🥉', }; // Couleurs de liseré lumineux par rang const glowColors: Record = { 1: 'shadow-[0_0_30px_rgba(250,204,21,0.3)] border-yellow-500/40', 2: 'shadow-[0_0_25px_rgba(156,163,175,0.25)] border-gray-400/40', 3: 'shadow-[0_0_20px_rgba(217,119,6,0.25)] border-amber-600/40', }; const exploitCount = pool.exploits || 0; return (
{/* Médaille en haut à droite */}
{medals[rank]}
{/* Protocol info with logo */}
{pool.protocolLogo ? ( {pool.protocol} { (e.target as HTMLImageElement).style.display = 'none'; (e.target as HTMLImageElement).parentElement!.innerHTML = `${pool.protocol.charAt(0)}`; }} /> ) : ( {pool.protocol.charAt(0)} )}

{pool.protocol} {pool.protocolType && ( {pool.protocolType === 'lending' ? 'Lending' : 'Vault'} )}

{pool.chainLogo && ( {pool.chain} { (e.target as HTMLImageElement).style.display = 'none'; }} /> )} {pool.chain} • {pool.stablecoinLogo && ( {pool.stablecoin} { (e.target as HTMLImageElement).style.display = 'none'; }} /> )} {pool.stablecoin} {/* Indicateur USD/EUR */} {pool.currency}
{/* APY highlight */}
Rendement annuel
{formatPercent(pool.apy)} APY
{pool.apyReward > 0 && (
Base: {formatPercent(pool.apyBase)} + Rewards: {formatPercent(pool.apyReward)}
)}
{/* Stats row */}
Sécurité
TVL
{formatNumber(pool.tvl)}
{/* Security details */}
{pool.audits} audits
{pool.protocolAge > 365 ? `${Math.floor(pool.protocolAge / 365)}+ ans` : `${pool.protocolAge} jours` }
{exploitCount > 0 && (
= 2 ? 'text-red-400' : 'text-yellow-400'}`}> âš  {exploitCount} exploit{exploitCount > 1 ? 's' : ''}
)}
{/* CTA */} Déposer
); } // Container pour les 3 top pools interface TopPoolsProps { pools: YieldPool[]; } export function TopPools({ pools }: TopPoolsProps) { if (pools.length === 0) return null; return (

Top rendements

Les meilleurs yields avec un score de sécurité optimal

{pools.slice(0, 3).map((pool, index) => ( ))}
); }