Files
roxane/resources/js/components/alert-error.tsx

25 lines
717 B
TypeScript
Raw Normal View History

2025-10-22 17:09:48 +02:00
import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert';
import { AlertCircleIcon } from 'lucide-react';
export default function AlertError({
errors,
title,
}: {
errors: string[];
title?: string;
}) {
return (
<Alert variant="destructive">
<AlertCircleIcon />
<AlertTitle>{title || 'Something went wrong.'}</AlertTitle>
<AlertDescription>
<ul className="list-inside list-disc text-sm">
{Array.from(new Set(errors)).map((error, index) => (
<li key={index}>{error}</li>
))}
</ul>
</AlertDescription>
</Alert>
);
}