| 1 | import { View } from "react-native"; |
| 2 | |
| 3 | import { AppText, AppTextInput, type AppTextInputProps } from "../../components/AppText"; |
| 4 | import { cn } from "../../lib/cn"; |
| 5 | |
| 6 | type ConnectionFormFieldProps = Omit<AppTextInputProps, "accessibilityLabel" | "className"> & { |
| 7 | readonly label: string; |
| 8 | readonly className?: string; |
| 9 | }; |
| 10 | |
| 11 | /** Labeled connection input with a native wrapper retained inside form sheets. */ |
| 12 | export function ConnectionFormField({ label, className, ...inputProps }: ConnectionFormFieldProps) { |
| 13 | return ( |
| 14 | <View collapsable={false} className={cn("gap-1.5", className)}> |
| 15 | <AppText |
| 16 | accessibilityElementsHidden |
| 17 | importantForAccessibility="no-hide-descendants" |
| 18 | className="text-2xs font-t3-bold tracking-[0.8px] uppercase text-foreground-muted" |
| 19 | > |
| 20 | {label} |
| 21 | </AppText> |
| 22 | <AppTextInput |
| 23 | {...inputProps} |
| 24 | accessibilityLabel={label} |
| 25 | className="rounded-[14px] px-4 py-3.5" |
| 26 | /> |
| 27 | </View> |
| 28 | ); |
| 29 | } |