Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / packages / pass / components / Form / legacy / PasswordField.tsx
blob92c0aa2c1d00aaf5663ea95c57dd91fbd51c04e6
1 /**
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..
7  */
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);
23     return (
24         <div className="flex flex-nowrap items-end mb-3 w-full">
25             <InputFieldTwo dense as={PasswordInputTwo} error={error} {...field} {...rest} />
26         </div>
27     );