import React from "react"; import { Button, ButtonVariant, Form, FormGroup, Modal, ModalVariant, TextContent, TextInput, ValidatedOptions, } from "@patternfly/react-core"; import { useTranslation } from "react-i18next"; import { useForm, UseFormMethods } from "react-hook-form"; import type UserRepresentation from "@keycloak/keycloak-admin-client/lib/defs/userRepresentation"; import { emailRegexPattern } from "../util"; type AddUserEmailModalProps = { id?: string; form: UseFormMethods; rename?: string; handleModalToggle: () => void; testConnection: () => void; user: UserRepresentation; save: (user?: UserRepresentation) => void; }; export const AddUserEmailModal = ({ handleModalToggle, save, }: AddUserEmailModalProps) => { const { t } = useTranslation("groups"); const { register, errors, handleSubmit, watch } = useForm(); const watchEmailInput = watch("email", ""); return ( {t("common:testConnection")} , , ]} > {t("realm-settings:provideEmail")}
); };