import type { FormValues } from "@pages/settings/my-account/profile"; import { useState } from "react"; import type { UseFormReturn } from "react-hook-form"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Badge, TextField, Dropdown, DropdownItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, Button, InputError, } from "@calcom/ui"; type CustomEmailTextFieldProps = { formMethods: UseFormReturn; formMethodFieldName: keyof FormValues; errorMessage: string; emailVerified: boolean; emailPrimary: boolean; dataTestId: string; handleChangePrimary: () => void; handleVerifyEmail: () => void; handleItemDelete: () => void; }; const CustomEmailTextField = ({ formMethods, formMethodFieldName, errorMessage, emailVerified, emailPrimary, dataTestId, handleChangePrimary, handleVerifyEmail, handleItemDelete, }: CustomEmailTextFieldProps) => { const { t } = useLocale(); const [inputFocus, setInputFocus] = useState(false); return ( <>
setInputFocus(true)} onBlur={() => setInputFocus(false)} />
{emailPrimary && ( {t("primary")} )} {!emailVerified && ( {t("unverified")} )}
{errorMessage && } ); }; export default CustomEmailTextField;