import { TextInput, Stack } from "@carbon/react";
import React from "react";
import { getTitleId } from "../helpers";
export const TextInputElement = ({ title, label, preFiledValue, setValue, placeholder }) => {
    const titleId = getTitleId(title);
    return (React.createElement(React.Fragment, null,
        React.createElement(Stack, { orientation: "horizontal" },
            React.createElement(Stack, { gap: 1 },
                React.createElement("h4", { id: titleId }, title),
                label && React.createElement("p", { className: "cds--modal-header__label" }, label)),
            React.createElement(TextInput, { id: `text-input-element-${Math.random() * 1000}`, placeholder: placeholder ?? "", labelText: "", value: preFiledValue ?? "", onChange: (event) => {
                    setValue(event.target.value);
                }, "aria-labelledby": titleId }))));
};
