import React from 'react'; import { Widget } from '../ChatWindow'; import Weather from './Weather'; import Calculation from './Calculation'; import Stock from './Stock'; const Renderer = ({ widgets }: { widgets: Widget[] }) => { return widgets.map((widget, index) => { switch (widget.widgetType) { case 'weather': return ( ); case 'calculation_result': return ( ); case 'stock': return ( ); default: return
Unknown widget type: {widget.widgetType}
; } }); }; export default Renderer;