"use client" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { TrendingUp, TrendingDown, Star } from "lucide-react" interface StockHeaderProps { symbol: string activeTab: string onTabChange: (tab: string) => void } export function StockHeader({ symbol, activeTab, onTabChange }: StockHeaderProps) { // Mock data - in real app this would come from an API const stockData = { TSLA: { name: "Tesla, Inc.", symbol: "TSLA", exchange: "NASDAQ", price: 423.39, afterHoursPrice: 417.13, change: 18.4, changePercent: 4.38, afterHoursChange: -6.26, afterHoursChangePercent: -1.48, lastUpdate: "At close: Sep 25, 4:00 PM EDT", afterHoursUpdate: "After hours: Sep 26, 6:08 AM EDT", }, } const stock = stockData[symbol as keyof typeof stockData] || stockData.TSLA const isPositive = stock.change > 0 const isAfterHoursPositive = stock.afterHoursChange > 0 const tabs = [ { id: "overview", label: "Overview" }, { id: "historical", label: "Historical Data" }, { id: "financials", label: "Financials" }, { id: "earnings", label: "Earnings" }, { id: "research", label: "Research" }, ] return (
T

{stock.name}

{stock.symbol} {stock.exchange} 🇺🇸
{/* Regular Hours */}
US${stock.price.toFixed(2)}
{isPositive ? ( ) : ( )} US${Math.abs(stock.change).toFixed(2)} {isPositive ? "+" : ""} {stock.changePercent.toFixed(2)}%

{stock.lastUpdate}

{/* After Hours */}
US${stock.afterHoursPrice.toFixed(2)}
{isAfterHoursPositive ? ( ) : ( )} US${Math.abs(stock.afterHoursChange).toFixed(2)} {isAfterHoursPositive ? "+" : ""} {stock.afterHoursChangePercent.toFixed(2)}%

{stock.afterHoursUpdate}

{tabs.map((tab) => ( ))}
) }