import Link from "../../Link/Link";
import useTranslateValue from "../../../Utils/Translation";
import React from "react";
const FieldLabelElement = (props) => {
    var _a, _b, _c, _d, _e, _f;
    const { translateString, translateValue } = useTranslateValue();
    const translatedTitle = (_a = translateString(props.title)) !== null && _a !== void 0 ? _a : props.title;
    const translatedSideLinkText = translateString((_b = props.sideLink) === null || _b === void 0 ? void 0 : _b.text);
    const translatedDescription = translateValue(props.description);
    return (React.createElement(React.Fragment, null,
        React.createElement("label", { className: props.className ||
                `block ${props.isHeading ? "text-lg" : "text-sm"}  font-medium text-gray-700 flex justify-between` },
            React.createElement("span", null,
                translatedTitle,
                " ",
                React.createElement("span", { className: "text-gray-400 text-xs" }, props.required || props.hideOptionalLabel
                    ? ""
                    : (_c = translateString("(Optional)")) !== null && _c !== void 0 ? _c : "(Optional)")),
            props.sideLink && translatedSideLinkText && ((_d = props.sideLink) === null || _d === void 0 ? void 0 : _d.url) && (React.createElement("span", { "data-testid": "login-forgot-password" },
                React.createElement(Link, { to: (_e = props.sideLink) === null || _e === void 0 ? void 0 : _e.url, openInNewTab: (_f = props.sideLink) === null || _f === void 0 ? void 0 : _f.openLinkInNewTab, className: "text-indigo-500 hover:text-indigo-900 cursor-pointer" }, translatedSideLinkText)))),
        translatedDescription && (React.createElement("div", { className: "mt-1 text-sm text-gray-500" }, translatedDescription))));
};
export default FieldLabelElement;
//# sourceMappingURL=FieldLabel.js.map