import Modal from './Modal.jsx'; function StudyGuideContent({ doc }) { return (

{doc.title}

{doc.sections?.map((section, i) => (

{section.heading}

{section.bullets?.length > 0 && ( )} {section.keyTerms?.length > 0 && (

Key Terms

{section.keyTerms.map((kt, j) => (
{kt.term}
{kt.definition}
))}
)} {section.reviewQuestions?.length > 0 && (

Self-Review

    {section.reviewQuestions.map((q, j) =>
  1. {q}
  2. )}
)}
))} {doc.mnemonics?.length > 0 && (

Memory Aids

)}
); } function FaqContent({ doc }) { return (

FAQ: {doc.subject}

{doc.faqPairs?.map((pair, i) => (

Q: {pair.question}

{pair.answer}

))}
); } function ExecBriefContent({ doc }) { return (

{doc.title}

{doc.sections?.map((section, i) => (

{section.subhead}

{section.prose}

))}
); } const LABELS = { 'study-guide': 'Study Guide', 'faq': 'F.A.Q.', 'executive-brief': 'Executive Brief', }; const RENDERERS = { 'study-guide': StudyGuideContent, 'faq': FaqContent, 'executive-brief': ExecBriefContent, }; function DocumentModal({ open, onClose, type, document: doc, loading }) { const Renderer = type ? RENDERERS[type] : null; const label = type ? LABELS[type] : ''; return ( {loading ? (

Generating {label}

) : ( <> {Renderer && doc && }
)}
); } export default DocumentModal;