2026-01-11 16:02:34 +00:00
|
|
|
import { ErrorDisplay } from '@/components/ui/ErrorDisplay';
|
2025-12-03 21:56:50 +00:00
|
|
|
|
|
|
|
|
interface AuthErrorMessageProps {
|
|
|
|
|
message: string;
|
|
|
|
|
className?: string;
|
|
|
|
|
id?: string;
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-11 16:02:34 +00:00
|
|
|
/**
|
|
|
|
|
* AuthErrorMessage - Displays authentication errors using ErrorDisplay component
|
|
|
|
|
*
|
|
|
|
|
* This component wraps ErrorDisplay to maintain backward compatibility
|
|
|
|
|
* with existing AuthErrorMessage usage while using the standardized
|
|
|
|
|
* ErrorDisplay component internally.
|
|
|
|
|
*
|
|
|
|
|
* @deprecated Consider using ErrorDisplay directly for new code
|
|
|
|
|
*/
|
2025-12-03 21:56:50 +00:00
|
|
|
export function AuthErrorMessage({
|
|
|
|
|
message,
|
|
|
|
|
className,
|
|
|
|
|
id,
|
|
|
|
|
}: AuthErrorMessageProps) {
|
|
|
|
|
if (!message) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
2026-01-11 16:02:34 +00:00
|
|
|
<div id={id}>
|
|
|
|
|
<ErrorDisplay
|
|
|
|
|
error={message}
|
|
|
|
|
variant="inline"
|
|
|
|
|
severity="error"
|
|
|
|
|
className={className}
|
|
|
|
|
context={{ action: 'authenticating', resource: 'auth' }}
|
|
|
|
|
dismissible={false}
|
|
|
|
|
/>
|
2025-12-03 21:56:50 +00:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|