import React from 'react'; import { ContentBlock } from '../types'; import { TerminalBlock } from './TerminalBlock'; import { GitWorkflowDiagram } from './GitWorkflowDiagram'; import { AlertTriangle, Lightbulb, Info, CheckCircle2, ChevronDown } from 'lucide-react'; import gsap from 'gsap'; interface ContentRendererProps { block: ContentBlock; } const Callout: React.FC<{ variant?: string; content: string }> = ({ variant = 'info', content }) => { const getIcon = () => { switch(variant) { case 'warning': return ; case 'tip': return ; case 'success': return ; default: return ; } }; const getStyles = () => { switch(variant) { case 'warning': return 'bg-destructive/10 border-destructive/20 text-foreground'; case 'tip': return 'bg-accent/10 border-accent/20 text-foreground'; case 'success': return 'bg-primary/10 border-primary/20 text-foreground'; default: return 'bg-secondary border-secondary-foreground/10 text-secondary-foreground'; } }; return (
{getIcon()}

{content}

); }; const Collapsible: React.FC<{ content: any, variant?: string }> = ({ content, variant }) => { const [isOpen, setIsOpen] = React.useState(false); const bodyRef = React.useRef(null); const contentRef = React.useRef(null); React.useEffect(() => { if (!contentRef.current || !bodyRef.current) return; if (isOpen) { gsap.to(bodyRef.current, { height: contentRef.current.scrollHeight, duration: 0.4, ease: "power2.out", opacity: 1 }); } else { gsap.to(bodyRef.current, { height: 0, duration: 0.3, ease: "power2.in", opacity: 0 }); } }, [isOpen]); const isPractice = variant === 'success'; return (
{Array.isArray(content.body) && content.body.map((subBlock: ContentBlock, idx: number) => ( ))}
); }; export const ContentRenderer: React.FC = ({ block }) => { switch (block.type) { case 'paragraph': return

{block.content as string}

; case 'code': return ; case 'callout': return ; case 'list': return (
    {(block.content as string[]).map((item, i) => (
  • {item}
  • ))}
); case 'ordered-list': return (
    {(block.content as string[]).map((item, i) => (
  1. {item}
  2. ))}
); case 'subheading': return

{block.content as string}

; case 'collapsible': return ; case 'diagram': return ; default: return null; } };