feat(silo attached detach): added in silo attach detach setup in the silo card
This commit is contained in:
16
frontend/src/utils/formStuff/options/FieldErrors.tsx
Normal file
16
frontend/src/utils/formStuff/options/FieldErrors.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import { AnyFieldMeta } from "@tanstack/react-form";
|
||||
import { ZodError } from "zod";
|
||||
|
||||
type FieldErrorsProps = {
|
||||
meta: AnyFieldMeta;
|
||||
};
|
||||
|
||||
export const FieldErrors = ({ meta }: FieldErrorsProps) => {
|
||||
if (!meta.isTouched) return null;
|
||||
|
||||
return meta.errors.map(({ message }: ZodError, index) => (
|
||||
<p key={index} className="text-sm font-medium text-destructive">
|
||||
{message}
|
||||
</p>
|
||||
));
|
||||
};
|
||||
Reference in New Issue
Block a user