import React from "react";
import {FormControl, TextField} from "@mui/material";

interface LabeledInputProps {
    id: string,
    label: string,
    helper: string,
    onContentChange: (content: string) => void,
    init?: string
}

function LabeledInput(props: LabeledInputProps) {
    return (
        <FormControl fullWidth sx={{m: 1}}>
            <TextField
                id={props.id}
                label={props.label}
                helperText={props.helper}
                multiline
                rows={2}
                defaultValue={props.init}
                variant="standard"
                onChange={event => props.onContentChange(event.target.value)}
            />
        </FormControl>
    );
}

export default LabeledInput;