import type { FieldValuesFromFieldErrors } from "@hookform/error-message"
import type {
  FieldErrors,
  FieldName,
  FieldValues,
  Message,
  MultipleFieldErrors,
} from "react-hook-form"

export type ErrorMessageProps<TFieldErrors> = {
  errors?: FieldErrors<FieldValues>
  name: FieldName<FieldValuesFromFieldErrors<TFieldErrors>>
  message?: Message
  render?: (data: {
    message: Message
    messages?: MultipleFieldErrors
  }) => React.ReactNode
}
