import React from 'react'; import dynamic from 'next/dynamic'; import { Widget } from '../ChatWindow'; import Weather from './Weather'; import Calculation from './Calculation'; import CardGallery from './CardGallery'; import KnowledgeCard from './KnowledgeCard'; import InlineImageGallery from './InlineImageGallery'; import VideoEmbed from './VideoEmbed'; import ProductCard from './ProductCard'; import VideoCard from './VideoCard'; import ProfileCard from './ProfileCard'; import PromoCard from './PromoCard'; const Stock = dynamic(() => import('./Stock'), { ssr: false }); const Renderer = ({ widgets }: { widgets: Widget[] }) => { return (
{widgets.map((widget, index) => { switch (widget.widgetType) { case 'weather': return ( ); case 'calculation_result': return ( ); case 'stock': return ( ); case 'products': return ( ); case 'videos': return ( ); case 'profiles': return ( ); case 'promos': return ( ); case 'knowledge_card': return ( ); case 'image_gallery': return ( ); case 'video_embed': return ( ); case 'product': return ( ); case 'video': return ( ); case 'profile': return ( ); case 'promo': return ( ); default: return null; } })}
); }; export default Renderer;