diff --git a/apps/frontend/app/components/Form/TextField.tsx b/apps/frontend/app/components/Form/TextField.tsx index bc25e1e..3e98ceb 100644 --- a/apps/frontend/app/components/Form/TextField.tsx +++ b/apps/frontend/app/components/Form/TextField.tsx @@ -1,6 +1,7 @@ import type { AnyFieldMeta } from '@tanstack/react-form'; import { LucideEye, LucideEyeClosed } from 'lucide-react'; import { useCallback, useId, useState } from 'react'; +import { InfoIcon, type InfoIconProps } from '../info'; export type TextFieldProps = { label?: string; @@ -8,12 +9,13 @@ export type TextFieldProps = { onChange?: (e: React.ChangeEvent) => void; labelProps?: React.LabelHTMLAttributes; labelDivProps?: React.HTMLAttributes; + infoIconProps?: InfoIconProps; } & React.InputHTMLAttributes & { type?: 'password'; showPasswordToggle?: boolean; }; -export function TextField({ label, value, onChange, labelProps, labelDivProps, showPasswordToggle, ...rest }: TextFieldProps) { +export function TextField({ label, value, onChange, labelProps, labelDivProps, showPasswordToggle, infoIconProps, ...rest }: TextFieldProps) { const id = useId(); const [isPasswordVisible, setIsPasswordVisible] = useState(false); const handlePasswordVisibilitySet = useCallback( @@ -24,11 +26,13 @@ export function TextField({ label, value, onChange, labelProps, labelDivProps, s }, [rest.type] ); + return (