import { jsx as _jsx } from "react/jsx-runtime";
import cx from "classnames";
import { FormattedMessage } from "react-intl";
import { simplifyText } from "@gooddata/util";
import { ShortenedText } from "../ShortenedText/ShortenedText.js";
/**
 * @internal
 */
export function DateDatasetsListItem({ id, title, isHeader, isSelected, isUnrelated, onClick, }) {
    if (isHeader) {
        return (_jsx("div", { className: "gd-list-item gd-list-item-header", children: _jsx(FormattedMessage, { id: title }) }));
    }
    const classNames = cx("gd-list-item", "gd-list-item-shortened", `s-${id}`, `s-${simplifyText(title ?? "")}`, {
        "is-selected": isSelected,
        "is-unrelated": isUnrelated,
    });
    const tooltipAlignPoints = [
        { align: "cl cr", offset: { x: -10, y: 0 } },
        { align: "cr cl", offset: { x: 10, y: 0 } },
    ];
    return (_jsx("div", { className: classNames, onClick: onClick, children: _jsx(ShortenedText, { tooltipAlignPoints: tooltipAlignPoints, children: title ?? "" }) }));
}
