import type { EmailField } from "@payloadcms/plugin-form-builder/types"; import type { FieldErrorsImpl, FieldValues, UseFormRegister } from "react-hook-form"; import React from "react"; import { Error } from "../Error"; import { Width } from "../Width"; export const Email: React.FC< { errors: Partial< FieldErrorsImpl<{ [x: string]: any; }> >; register: UseFormRegister; } & EmailField > = ({ name, errors, label, register, required: requiredFromProps, width }) => { return (
{requiredFromProps && errors[name] && }
); };