// import { Badge } from "@/components/ui/badge"; import { Separator } from "@/components/ui/separator"; import { DashboardStockItem } from "@/features/dashboard/types/dashboard.types"; import { cn } from "@/lib/utils"; interface StockHeaderProps { stock: DashboardStockItem; price: string; change: string; changeRate: string; high?: string; low?: string; volume?: string; } export function StockHeader({ stock, price, change, changeRate, high, low, volume, }: StockHeaderProps) { const isRise = changeRate.startsWith("+") || parseFloat(changeRate) > 0; const isFall = changeRate.startsWith("-") || parseFloat(changeRate) < 0; const colorClass = isRise ? "text-red-500" : isFall ? "text-blue-500" : "text-foreground"; return (
{/* ========== STOCK SUMMARY ========== */}

{stock.name}

{stock.symbol}/{stock.market}
{price} {changeRate}% {change}
{/* ========== STATS ========== */}

고가

{high || "--"}

저가

{low || "--"}

거래량(24H)

{volume || "--"}

{/* ========== DESKTOP STATS ========== */}
고가 {high || "--"}
저가 {low || "--"}
거래량(24H) {volume || "--"}
); }