import React from 'react'; import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons/faExclamationCircle'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { Alert, Center, Stack } from '@mantine/core'; function Message({ title, children, alertProps, dataTestId, }: { title?: React.ReactNode; children: React.ReactNode; alertProps?: React.ComponentProps; dataTestId?: string; }) { return ( } {...alertProps} data-test-id={dataTestId}> {children} ); } export function ErrorMessage({ title, children, alertProps, dataTestId, centered, style, }: { /** * Optional title for the message. */ title?: React.ReactNode; /** * The content of the message. */ children: React.ReactNode; /** * Props for the Mantine Alert component. */ alertProps?: React.ComponentProps; /** * data-testid attribute for testing. */ dataTestId?: string; /** * If true, the message will be centered in the parent container. */ centered?: boolean; /** * If centered is true, style object for the container. */ style?: React.CSSProperties; }) { return centered ? (
{children}
) : ( {children} ); }