login form created
This commit is contained in:
18
frontend/src/lib/formSutff/Errors.Field.tsx
Normal file
18
frontend/src/lib/formSutff/Errors.Field.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { AnyFieldMeta } from "@tanstack/react-form";
|
||||
|
||||
type FieldErrorsProps = {
|
||||
meta: AnyFieldMeta;
|
||||
};
|
||||
|
||||
export const FieldErrors = ({ meta }: FieldErrorsProps) => {
|
||||
if (!meta.isTouched) return null;
|
||||
|
||||
return meta.errors.map((error) => (
|
||||
<p
|
||||
key={`${error.message}-${error.code ?? "err"}`}
|
||||
className="text-sm font-medium text-destructive"
|
||||
>
|
||||
{error.message}
|
||||
</p>
|
||||
));
|
||||
};
|
||||
Reference in New Issue
Block a user