import { jsx as _jsx } from "react/jsx-runtime";
// (C) 2023-2026 GoodData Corporation
import { useMemo } from "react";
import cx from "classnames";
import { ShortenedText } from "@gooddata/sdk-ui-kit";
import { simplifyText } from "@gooddata/util";
const TOOLTIP_ALIGN_POINT = [
    { align: "cr cl", offset: { x: 10, y: 0 } },
    { align: "cl cr", offset: { x: -10, y: 0 } },
];
export function DateAttributeListItem({ item, title, onClick }) {
    const classNames = useMemo(() => {
        return cx(`s-${simplifyText(item.dataSet.title)}`, "gd-attribute-list-item", {
            "gd-list-item": true,
            "gd-list-item-shortened": true,
            "type-date": true,
        });
    }, [item]);
    return (_jsx("div", { className: classNames, onClick: onClick, children: _jsx(ShortenedText, { tooltipAlignPoints: TOOLTIP_ALIGN_POINT, children: getDateAttributeListItemTitle(item, title) }) }, item.dataSet.id));
}
export const getDateAttributeListItemTitle = (item, title) => {
    return title ?? item.dataSet.title;
};
//# sourceMappingURL=DateAttributeListItem.js.map