import { ReactNode } from 'react'; import { Group, useMantineTheme, List, Tooltip } from '@mantine/core'; import { AlertTriangle, Info } from 'lucide-react'; interface WarningItem { type: 'warning' | 'info'; message: string; } interface WarningDisplayProps { warnings: WarningItem[]; children?: ReactNode; } export const WarningDisplay = ({ warnings, children }: WarningDisplayProps) => { const theme = useMantineTheme(); if (warnings.length === 0) { return {children}; } const warningMessages = warnings.filter((w) => w.type === 'warning'); const infoMessages = warnings.filter((w) => w.type === 'info'); return ( {warningMessages.length > 0 && ( {warningMessages.map((warning, index) => ( {warning.message} ))} ) } multiline maw={320} > )} {infoMessages.length > 0 && ( {infoMessages.map((info, index) => ( {info.message} ))} ) } multiline maw={320} > )} {children} ); };