import { jsx as _jsx } from "react/jsx-runtime";
import { UiButton } from "@gooddata/sdk-ui-kit";
import { getSortedSignificantDriver } from "../../tools/sortedKeyDrivers.js";
export const driverColumn = (intl, width) => {
    return {
        label: intl.formatMessage({ id: "kdaDialog.dialog.keyDrives.overview.detail.table.driver" }),
        key: "significantDrivers",
        width,
        align: "left",
        getTextContent: (item) => {
            if (item.significantDrivers.length === 0) {
                return "-";
            }
            const first = getSortedSignificantDriver(item)[0];
            return _jsx(UiButton, { tabIndex: -1, label: first.category, variant: "tertiary", size: "small" });
        },
    };
};
