'use client'; import React from 'react'; interface LeftDocumentPanelProps { onSelectQuestion?: (q: string) => void; onCollapse?: () => void; recentQuestions?: string[]; } interface FAQItem { question: string; tag: string; } export function LeftDocumentPanel({ onSelectQuestion, onCollapse, recentQuestions = [], }: LeftDocumentPanelProps) { const defaultFaqGroups: { title: string; items: FAQItem[] }[] = [ { title: "Today", items: [ { question: "What was the Net Interest Margin in Q1 2026?", tag: "Margin & NIM" }, { question: "How did Net Profit perform year-on-year?", tag: "Profitability" }, { question: "How did business segment performance vary across RBWM, CIB, GM&T and DenizBank?", tag: "Segments" }, { question: "What ESG progress did Emirates NBD report in the presentation?", tag: "ESG" }, { question: "How did loans and deposits perform in Q1 2026?", tag: "Loans & Deposits" }, { question: "What is the loans by sector distribution?", tag: "Sector Mix" }, { question: "What were the key Q1 2026 performance highlights?", tag: "Highlights" }, ], }, { title: "Last 7 days", items: [ { question: "What is the Capital Adequacy Ratio?", tag: "Capital Strength" }, { question: "What drove the improvement in Cost of Risk?", tag: "Credit Quality" }, { question: "Which business segment contributed most to operating income and PBT?", tag: "Segment PBT" }, { question: "What are the sustainable finance and ESG rating highlights?", tag: "ESG Ratings" }, { question: "What drove loan growth and deposit growth?", tag: "Growth Drivers" }, { question: "How diversified is the gross loan book by sector?", tag: "Loan Sectors" }, { question: "How did total income and operating income perform?", tag: "Income" }, ], }, { title: "Last 30 days", items: [ { question: "How did the retail banking segment perform?", tag: "Retail Segment" }, { question: "What is the liquidity coverage ratio?", tag: "Liquidity" }, { question: "Compare divisional performance across operating income, costs and PBT.", tag: "Divisions" }, { question: "What are the ESG forward journey and net-zero milestones?", tag: "ESG Roadmap" }, { question: "What is the CASA ratio and deposit mix?", tag: "Deposit Mix" }, { question: "What sector concentration risks are visible in the loan portfolio?", tag: "Sector Risk" }, { question: "What are the funding and liquidity strengths of the group?", tag: "Funding" }, ], }, ]; const existingQuestions = new Set( defaultFaqGroups.flatMap(group => group.items.map(item => item.question.toLowerCase())) ); const recentItems = recentQuestions .filter(question => !existingQuestions.has(question.toLowerCase())) .map(question => ({ question, tag: "Recent" })); const faqGroups = recentItems.length > 0 ? [{ title: "Recent Questions", items: recentItems }, ...defaultFaqGroups] : defaultFaqGroups; return ( ); }