import React from 'react'; import { Text, View } from 'react-native'; import { useThemedStyles } from '../../../theme'; import { makeStyles } from './styles'; import type { FormRowProps } from './types'; /** * 带 label 的单行表单项。布局:左 label · 右控件。最小高度 48。 */ export function FormRow({ label, children, required, error, testID, }: FormRowProps): React.JSX.Element { const styles = useThemedStyles(makeStyles); return ( {label} {required ? * : null} {children} {/* [L-31] accessibilityLiveRegion="polite" —— error 出现时 SR 自动播报, 不干扰当前朗读(polite 排队等当前发言结束)。 */} {error ? ( {error} ) : null} ); }