import * as React from 'react'; import type { SxProps } from '@mui/joy/styles/types'; import { FormControl, Input } from '@mui/joy'; import { FormLabelStart } from './FormLabelStart'; const _styles = { formControl: { flexWrap: 'wrap', justifyContent: 'space-between', alignItems: 'center', }, inputDefault: { flexGrow: 1, }, } as const satisfies Record; /** * Text form field (e.g. enter a host) */ export function FormTextField(props: { autoCompleteId: string, title: string | React.JSX.Element, description?: string | React.JSX.Element, tooltip?: string | React.JSX.Element, placeholder?: string, isError?: boolean, disabled?: boolean, value: string | undefined, onChange: (text: string) => void, inputSx?: SxProps, }) { const acId = 'text-' + props.autoCompleteId; return ( props.onChange(event.target.value)} sx={props.inputSx ?? _styles.inputDefault} /> ); }