import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; import React from "react"; import {IconDefinition} from "@fortawesome/fontawesome-svg-core"; import {faPlus, faTrash} from "@fortawesome/free-solid-svg-icons"; interface InputFieldProps { icon?: IconDefinition, fieldName?: string, input: React.ReactNode, addButtonCallBack?: () => Promise removeButtonCallBack?: () => Promise isAddButtonDisabled?: boolean action?: () => Promise actionLabel?: string actionIcon?: IconDefinition hint?: string, } export default function InputField( { fieldName, icon, input, addButtonCallBack, removeButtonCallBack, isAddButtonDisabled, action, actionLabel, actionIcon, hint }: InputFieldProps) { return (
{ fieldName && (

{ icon && } {fieldName}

) } { action && ( ) } {hint && ( {hint} )}
{input} { addButtonCallBack && ( ) } { removeButtonCallBack && ( ) }
) }