import { ArrowLeftIcon } from '@heroicons/react/24/outline'; import { useEffect, useState } from 'react'; import { useNavigate, useParams } from 'react-router-dom'; import { ChartPage } from '../charts/ChartPage'; import type { Symbol } from './types'; const tabs = [ { id: 'chart', name: 'Chart' }, { id: 'financials', name: 'Financials' }, { id: 'filings', name: 'Filings' }, { id: 'insiders', name: 'Insiders' }, { id: 'shorts', name: 'Shorts' }, { id: 'sentiment', name: 'Sentiment' }, { id: 'news', name: 'News' }, { id: 'info', name: 'Info' }, ]; // Mock symbol data - in real app would fetch from API const mockSymbolData: Record = { 'AAPL': { symbol: 'AAPL', name: 'Apple Inc.', exchange: 'NASDAQ', country: 'US', type: 'Common Stock', currency: 'USD', marketCap: 3.48e12, sector: 'Technology', industry: 'Consumer Electronics' }, 'SHOP': { symbol: 'SHOP', name: 'Shopify Inc.', exchange: 'TSX', country: 'CA', type: 'Common Stock', currency: 'CAD', marketCap: 135e9, sector: 'Technology', industry: 'E-Commerce Software' }, 'TD': { symbol: 'TD', name: 'Toronto-Dominion Bank', exchange: 'TSX', country: 'CA', type: 'Common Stock', currency: 'CAD', marketCap: 150e9, sector: 'Financial', industry: 'Banks' }, }; export function SymbolDetailPage() { const { symbol } = useParams<{ symbol: string }>(); const navigate = useNavigate(); const [activeTab, setActiveTab] = useState('chart'); const [symbolData, setSymbolData] = useState(null); const [isLoading, setIsLoading] = useState(true); useEffect(() => { // Simulate API call to fetch symbol data setIsLoading(true); setTimeout(() => { const data = mockSymbolData[symbol || ''] || { symbol: symbol || 'UNKNOWN', name: 'Unknown Company', exchange: 'UNKNOWN', country: 'US', type: 'Common Stock', currency: 'USD', }; setSymbolData(data); setIsLoading(false); }, 500); }, [symbol]); if (isLoading) { return (
); } if (!symbolData) { return (

Symbol not found

); } const renderTabContent = () => { switch (activeTab) { case 'chart': return ; case 'financials': return (

Financial Statements

Financial data coming soon...

); case 'filings': return (

SEC Filings

Filings data coming soon...

); case 'insiders': return (

Insider Trading

Insider trading data coming soon...

); case 'shorts': return (

Short Interest

Short interest data coming soon...

); case 'sentiment': return (

Market Sentiment

Sentiment analysis coming soon...

); case 'news': return (

Latest News

News feed coming soon...

); case 'info': return (

Company Information

Symbol
{symbolData.symbol}
Name
{symbolData.name}
Exchange
{symbolData.exchange}
Country
{symbolData.country}
Type
{symbolData.type}
Currency
{symbolData.currency}
{symbolData.sector && (
Sector
{symbolData.sector}
)} {symbolData.industry && (
Industry
{symbolData.industry}
)}
); default: return null; } }; return (
{/* Header with Tabs */}

{symbolData.symbol} {symbolData.exchange}

{symbolData.name}

{/* Tabs */}
{/* Tab Content */}
{renderTabContent()}
); }