import TradingViewWidget from "@/components/TradingViewWidget"; import WatchlistButton from "@/components/WatchlistButton"; import StockAIAnalysisCard from "@/components/stocks/StockAIAnalysisCard"; import StockSentimentCard from "@/components/stocks/StockSentimentCard"; import { SYMBOL_INFO_WIDGET_CONFIG, CANDLE_CHART_WIDGET_CONFIG, BASELINE_WIDGET_CONFIG, TECHNICAL_ANALYSIS_WIDGET_CONFIG, COMPANY_PROFILE_WIDGET_CONFIG, COMPANY_FINANCIALS_WIDGET_CONFIG, } from "@/lib/constants"; import { auth } from '@/lib/better-auth/auth'; import { headers } from 'next/headers'; import { isStockInWatchlist } from '@/lib/actions/watchlist.actions'; import { getStockSentimentInsights } from '@/lib/actions/adanos.actions'; import { formatSymbolForTradingView } from '@/lib/utils'; export default async function StockDetails({ params }: StockDetailsPageProps) { const { symbol } = await params; const tvSymbol = formatSymbolForTradingView(symbol); const scriptUrl = `https://s3.tradingview.com/external-embedding/embed-widget-`; const session = await auth.api.getSession({ headers: await headers() }); const userId = session?.user?.id; const [isInWatchlist, sentimentInsights] = await Promise.all([ userId ? isStockInWatchlist(userId, symbol) : Promise.resolve(false), getStockSentimentInsights(symbol), ]); return (