'use client'; import { useState } from 'react'; import { motion } from 'framer-motion'; import { ArrowUpRight, ArrowDownRight, TrendingUp, AlertTriangle, ChevronUp } from 'lucide-react'; import { useDataKeys } from '@/hooks/useDataStore'; export default function GlobalTicker() { const { stocks, financial_source } = useDataKeys(['stocks', 'financial_source'] as const); const entries = Object.entries(stocks || {}); const fallback = financial_source === 'yfinance'; if (entries.length === 0) return null; // Render a single ticker item const renderItem = ([ticker, info]: [string, any], index: number) => { // Determine color based on price action let colorClass = 'text-white'; if (info.change_percent > 0) colorClass = 'text-green-400'; if (info.change_percent < 0) colorClass = 'text-red-400'; const isCryptoHighlight = ticker === 'BTC' || ticker === 'ETH'; return (