import { jsx as _jsx } from "react/jsx-runtime";
// (C) 2022-2026 GoodData Corporation
import cx from "classnames";
import { ShortenedText } from "@gooddata/sdk-ui-kit";
import { simplifyText } from "@gooddata/util";
const getDisplayFormIcon = (type) => {
    switch (type) {
        case "GDC.link":
            return "gd-icon-hyperlink-warning";
        case "GDC.image":
            return "gd-icon-image";
        case "GDC.geo.pin":
        case "GDC.geo.pin_latitude":
        case "GDC.geo.pin_longitude":
            return "gd-icon-earth";
        default:
            return "gd-icon-label-warning";
    }
};
const tooltipAlignPoints = [
    { align: "cl cr", offset: { x: -10, y: 0 } },
    { align: "cr cl", offset: { x: 10, y: 0 } },
];
export function AttributeDisplayFormDropDownItem({ displayForm, onClick, selected, }) {
    const { title } = displayForm;
    const className = cx("gd-list-item", "attribute-display-form-name", "s-attribute-display-form-name", `s-attribute-display-form-name-${simplifyText(title)}`, getDisplayFormIcon(displayForm.displayFormType), {
        "is-selected": selected,
    });
    const handleOnClick = () => {
        onClick(displayForm.ref);
    };
    return (_jsx("div", { className: className, onClick: handleOnClick, children: _jsx(ShortenedText, { tooltipAlignPoints: tooltipAlignPoints, children: title }) }));
}
//# sourceMappingURL=AttributeDisplayFormDropDownItem.js.map