import React from "react"; import {LucideIcon, Plus, Trash2} from "lucide-react"; import IconButton from "@/components/ui/IconButton"; import Button from "@/components/ui/Button"; import Badge from "@/components/ui/Badge"; interface InputFieldProps { icon?: LucideIcon; fieldName?: string; input: React.ReactNode; addButtonCallBack?: () => Promise; removeButtonCallBack?: () => Promise; isAddButtonDisabled?: boolean; action?: () => Promise; actionLabel?: string; actionIcon?: LucideIcon; hint?: string; centered?: boolean; } export default function InputField( { fieldName, icon, input, addButtonCallBack, removeButtonCallBack, isAddButtonDisabled, action, actionLabel, actionIcon, hint, centered = false }: InputFieldProps) { function renderIcon(): React.JSX.Element | null { if (!icon) return null; const Icon: LucideIcon = icon; return ; } return (
{fieldName && (

{renderIcon()} {fieldName}

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