Commit eb8a938b authored by ohrdlicka's avatar ohrdlicka
Browse files

refactor(frontend): removed leftover duplicate component

parent a2ea3901
Loading
Loading
Loading
Loading
+0 −39
Original line number Diff line number Diff line
import TextField from '@mui/material/TextField';
import React, { FC } from 'react';
import { Control, Controller, FieldValues } from 'react-hook-form';

export interface FormInputProps {
    control: Control<FieldValues, any> | undefined;
    name: string;
    label: string;
}

export interface TextInputProps extends FormInputProps {
    fullWidth: boolean;
}

export const FormTextInput: FC<TextInputProps> = ({
    control,
    name,
    label,
    fullWidth,
}) => {
    return (
        <form>
            <Controller
                name={name}
                control={control}
                render={({ field: { onChange, value } }) => (
                    <>
                        <TextField
                            fullWidth={fullWidth}
                            onChange={onChange}
                            value={value}
                            label={label}
                        />
                    </>
                )}
            />
        </form>
    );
};