import React from 'react'; import { InformationCircleIcon, ExclamationTriangleIcon } from './Icons'; interface InfoPanelProps { title?: string; type: 'note' | 'info' | 'warning'; children: React.ReactNode; } export const InfoPanel: React.FC = ({ title, type, children }) => { let panelClasses = 'p-4 rounded-md my-6 border-l-4 shadow-md'; let titleClasses = 'font-semibold mb-2'; let IconComponent: React.FC> | null = null; switch (type) { case 'info': panelClasses += ' bg-blue-900/30 border-blue-500 text-blue-200'; titleClasses += ' text-blue-300'; IconComponent = InformationCircleIcon; break; case 'warning': panelClasses += ' bg-yellow-900/30 border-yellow-500 text-yellow-200'; titleClasses += ' text-yellow-300'; IconComponent = ExclamationTriangleIcon; break; case 'note': default: panelClasses += ' bg-gray-800 border-purple-500 text-gray-300'; titleClasses += ' text-purple-300'; IconComponent = InformationCircleIcon; // Default to info icon for notes break; } return (
{title && (
{IconComponent && }

{title}

)}
{children}
); };