/* * ============================================================================= * VibeQuant (vquant) — AI-Powered Financial Intelligence Platform * ----------------------------------------------------------------------------- * File: client/src/components/explore/stock-header.tsx * * Author: Simon-Pierre Boucher * Contact: contact@spboucher.ai * Website: https://www.spboucher.ai * Demo: https://www.vquant.ai * License: MIT (see LICENSE) * * Copyright © 2026 Simon-Pierre Boucher. All rights reserved. * ============================================================================= */ import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Card, CardContent } from "@/components/ui/card"; import { ArrowLeft, TrendingUp, TrendingDown, Building2, Globe, ExternalLink, DollarSign } from "lucide-react"; interface CompanyProfile { symbol: string; companyName: string; industry: string; sector: string; ceo: string; website: string; description: string; country: string; city: string; address: string; employees: number; marketCap: number; image: string; exchange: string; isin: string; cusip: string; phone: string; } interface StockQuote { symbol: string; price: number; change: number; changesPercentage: number; dayLow: number; dayHigh: number; yearHigh: number; yearLow: number; marketCap: number; priceAvg50: number; priceAvg200: number; volume: number; avgVolume: number; open: number; previousClose: number; eps: number; pe: number; earningsAnnouncement: string; sharesOutstanding: number; timestamp: number; } interface StockHeaderProps { ticker: string; companyProfile?: CompanyProfile; stockQuote?: StockQuote; onBack: () => void; } export function StockHeader({ ticker, companyProfile, stockQuote, onBack }: StockHeaderProps) { const isPositive = (stockQuote?.changesPercentage ?? 0) >= 0; const formatNumber = (num: number) => { if (num >= 1e12) return `$${(num / 1e12).toFixed(2)}T`; if (num >= 1e9) return `$${(num / 1e9).toFixed(2)}B`; if (num >= 1e6) return `$${(num / 1e6).toFixed(2)}M`; if (num >= 1e3) return `$${(num / 1e3).toFixed(2)}K`; return `$${num.toFixed(2)}`; }; const formatVolume = (vol: number) => { if (vol >= 1e9) return `${(vol / 1e9).toFixed(2)}B`; if (vol >= 1e6) return `${(vol / 1e6).toFixed(2)}M`; if (vol >= 1e3) return `${(vol / 1e3).toFixed(2)}K`; return vol.toString(); }; return (
{companyProfile.description}
)} {companyProfile && (