import React from 'react'; import { VideoPlayer } from './video-player'; import { ImageViewer } from './image-viewer'; import { MarkdownViewer } from './markdown-viewer'; import { useChat } from '../../providers/chat-provider'; import '../../styles/projector.css'; export function ProjectorView() { const { line } = useChat(); const [content, setContent] = React.useState(null); React.useEffect(() => { if (!line) return; const subscription = line.activity$ .subscribe((activity: any) => { if (activity.type === 'event' && activity.name === 'project') { setContent(activity.value); } }); return () => subscription.unsubscribe(); }, [line]); const renderContent = () => { if (!content) return null; switch (content.type) { case 'video': return ; case 'image': return ; case 'markdown': return ; default: return null; } }; return (
{renderContent()}
); }