import React from "react";
import { Checkbox, CheckboxGroup } from "../../form/checkbox/index.js";
function DataGridPreferencesColumnLayoutSettings({ value, onChange = () => null, fields, }) {
    const { columnDividers, stickyColumns } = value;
    const showColumnDividers = (fields === null || fields === void 0 ? void 0 : fields.columnDividers) !== false;
    const showStickyColumns = (fields === null || fields === void 0 ? void 0 : fields.stickyColumns) !== false;
    if (!showColumnDividers && !showStickyColumns) {
        return null;
    }
    const checkboxValues = [
        ...(columnDividers ? ["columnDividers"] : []),
        ...(stickyColumns.start ? ["sticky-start"] : []),
        ...(stickyColumns.end ? ["sticky-end"] : []),
    ];
    return (React.createElement(CheckboxGroup, { legend: "Kolonneegenskaper", size: "small", value: checkboxValues, onChange: (values) => {
            onChange({
                columnDividers: showColumnDividers
                    ? values.includes("columnDividers")
                    : columnDividers,
                stickyColumns: showStickyColumns
                    ? {
                        start: values.includes("sticky-start") ? 1 : undefined,
                        end: values.includes("sticky-end") ? 1 : undefined,
                    }
                    : stickyColumns,
            });
        } },
        showColumnDividers && (React.createElement(Checkbox, { value: "columnDividers" }, "Skillelinje mellom kolonner")),
        showStickyColumns && (React.createElement(Checkbox, { value: "sticky-start" }, "Fest f\u00F8rste kolonne")),
        showStickyColumns && (React.createElement(Checkbox, { value: "sticky-end" }, "Fest siste kolonne"))));
}
export { DataGridPreferencesColumnLayoutSettings };
//# sourceMappingURL=DataGridPreferencesColumnLayoutSettings.js.map