Initial Commit

This commit is contained in:
Ahmad 2024-02-14 21:30:10 -05:00
commit f3e2f01bd7
No known key found for this signature in database
GPG key ID: 8FD8A93530D182BF
150 changed files with 13612 additions and 0 deletions

View file

@ -0,0 +1,28 @@
import { XCircle } from "lucide-react";
interface FormErrorsProps {
id: string;
errors?: Record<string, string[] | undefined>;
}
export const FormErrors = ({ id, errors }: FormErrorsProps) => {
if (!errors) return null;
return (
<div
id={`${id}-error`}
aria-live="polite"
className="mt-2 text-xs text-rose-500"
>
{errors?.[id]?.map((error: string) => (
<div
key={error}
className="flex items-center font-medium p-2 border border-rose-500 bg-rose-500/10 rounded-sm"
>
<XCircle className="h-4 w-4 mr-2" />
{error}
</div>
))}
</div>
);
};