1 import type { ChangeEvent } from 'react';
3 import TextAreaTwo from '@proton/components/components/v2/input/TextArea';
4 import { getAllFieldLabels } from '@proton/shared/lib/helpers/contacts';
5 import type { VCardProperty } from '@proton/shared/lib/interfaces/contacts/VCard';
8 vCardProperty: VCardProperty<string>;
9 onChange: (vCardProperty: VCardProperty) => void;
12 const ContactFieldNote = ({ vCardProperty, onChange, ...rest }: Props) => {
13 const label = getAllFieldLabels().note;
15 const handleChange = ({ target }: ChangeEvent<HTMLTextAreaElement>) => {
16 const newValue = target.value;
17 onChange({ ...vCardProperty, value: newValue });
20 const value = vCardProperty.value || '';
22 return <TextAreaTwo value={value} placeholder={label} onChange={handleChange} data-testid={label} {...rest} />;
25 export default ContactFieldNote;