"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SettingsSection = exports.SettingsSectionSummary = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const FormLayout_1 = tslib_1.__importStar(require("../../../../components/FormLayout"));
const Input_1 = tslib_1.__importDefault(require("../../../../components/Input"));
const Radio_1 = tslib_1.__importDefault(require("../../../../components/Radio"));
const Tabs_1 = require("../../../../components/Tabs");
const Tag_1 = require("../../../../components/Tag");
const OnePageAdaptableWizard_1 = require("../../../Wizard/OnePageAdaptableWizard");
const isPivotLayout_1 = require("../../../../Utilities/isPivotLayout");
const Flex_1 = require("../../../../components/Flex");
const SettingsSectionSummary = () => {
    const { data: layout } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
    const isPivot = (0, isPivotLayout_1.isPivotLayout)(layout);
    return (React.createElement(Flex_1.Box, null,
        React.createElement(Tag_1.Tag, { className: "twa:mr-2" },
            "Layout Name: ",
            layout.Name),
        React.createElement(Tag_1.Tag, { className: "twa:mr-2" },
            "Layout Grid Type: ",
            isPivot ? 'Pivot' : 'Table'),
        React.createElement(Tag_1.Tag, { className: "twa:mr-2" },
            "Suppress Aggregation Function in Column Header:",
            ' ',
            layout.SuppressAggFuncInHeader ? 'Yes' : 'No')));
};
exports.SettingsSectionSummary = SettingsSectionSummary;
const SettingsSection = (props) => {
    const { data: layout } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
    const onNameChange = (event) => {
        props.onChange({
            ...layout,
            Name: event.target.value,
        });
    };
    return (React.createElement(React.Fragment, null,
        React.createElement(Tabs_1.Tabs, { className: "twa:mb-3" },
            React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
            React.createElement(Tabs_1.Tabs.Content, null,
                React.createElement(Flex_1.Flex, { flexDirection: "row" },
                    React.createElement(FormLayout_1.default, { className: "twa:max-w-[300px] twa:w-full" },
                        React.createElement(FormLayout_1.FormRow, { label: "Name" },
                            React.createElement(Input_1.default, { className: "twa:w-full", "data-name": "layout-name", onChange: onNameChange, value: layout?.Name ?? '' })))))),
        React.createElement(Tabs_1.Tabs, { className: "twa:mb-2" },
            React.createElement(Tabs_1.Tabs.Tab, null, "Grid Type"),
            React.createElement(Tabs_1.Tabs.Content, null,
                React.createElement(Flex_1.Flex, { flexDirection: "column" },
                    React.createElement(Radio_1.default, { "data-name": "layout-type-table", disabled: true, checked: !(0, isPivotLayout_1.isPivotLayout)(layout) }, "Table"),
                    React.createElement(Radio_1.default, { "data-name": "layout-type-pivot", disabled: true, checked: (0, isPivotLayout_1.isPivotLayout)(layout) }, "Pivot"))))));
};
exports.SettingsSection = SettingsSection;
