import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2023-2026 GoodData Corporation
import cx from "classnames";
import { useIntl } from "react-intl";
import { Input } from "@gooddata/sdk-ui-kit";
import { simplifyText } from "@gooddata/util";
import { messages } from "../locales.js";
export function DetailRow({ labelText, value, mode, disabled, onChange }) {
    const intl = useIntl();
    const viewClassNames = cx("gd-user-management-dialog-detail-value", {
        "gd-user-management-dialog-detail-value-empty": !value,
    });
    const inputClassNames = cx("gd-user-management-dialog-detail-input", `s-user-management-input-${simplifyText(labelText)}`);
    return (_jsxs("div", { className: "gd-user-management-dialog-detail-row", children: [
            _jsx("div", { className: "gd-user-management-dialog-detail-label", children: labelText }), mode === "VIEW" && (_jsx("div", { className: viewClassNames, children: value || intl.formatMessage(messages.emptyDetailValue) })), mode === "EDIT" && (_jsx("div", { children: _jsx(Input, { value: value, disabled: disabled, onChange: onChange, className: inputClassNames }) }))] }));
}
//# sourceMappingURL=DetailRow.js.map