2 * TODO: this component is still used in the Exporter
3 * and the ImportForm components. Disabled password
4 * generation on this component for now.. It was used
5 * in the Exporter to generate a password for PGP
6 * encryption but we can do without for now..
8 import type { FC } from 'react';
10 import type { FieldProps } from 'formik';
11 import type { PolymorphicPropsWithoutRef } from 'packages/react-polymorphic-types';
13 import { InputFieldTwo, PasswordInputTwo } from '@proton/components';
14 import type { InputFieldOwnProps } from '@proton/components/components/v2/field/InputField';
15 import { useFieldControl } from '@proton/pass/hooks/useFieldControl';
17 type PasswordFieldProps = FieldProps & PolymorphicPropsWithoutRef<InputFieldOwnProps, typeof PasswordInputTwo>;
19 export const PasswordField: FC<PasswordFieldProps> = (fieldProps) => {
20 const { field, form, ...rest } = fieldProps;
21 const { error } = useFieldControl(fieldProps);
24 <div className="flex flex-nowrap items-end mb-3 w-full">
25 <InputFieldTwo dense as={PasswordInputTwo} error={error} {...field} {...rest} />