"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FormatColumnTargetWizardSection = exports.renderFormatColumnTargetSummary = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
const Tabs_1 = require("../../../components/Tabs");
const rebass_1 = require("rebass");
const TypeRadio_1 = require("../../Wizard/TypeRadio");
const renderFormatColumnTargetSummary = (data) => {
    if (!data.Target || data.Target === 'cell') {
        return 'Column Cells';
    }
    if (data.Target === 'columnHeader') {
        return 'Column Header';
    }
};
exports.renderFormatColumnTargetSummary = renderFormatColumnTargetSummary;
const FormatColumnTargetWizardSection = (props) => {
    const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
    const currentTarget = data.Target ? data.Target : 'cell';
    const handleTargetChange = (target) => {
        // Update the formatColumn object
        props.onChange({
            ...data,
            Target: target,
        });
    };
    return (React.createElement(React.Fragment, null,
        React.createElement(Tabs_1.Tabs, { mb: 3 },
            React.createElement(Tabs_1.Tabs.Tab, null, "Target"),
            React.createElement(Tabs_1.Tabs.Content, null,
                React.createElement(rebass_1.Flex, { flexDirection: "column" },
                    React.createElement(TypeRadio_1.TypeRadio, { "data-name": "target-column-cell", text: 'Column Cells', description: "Column Cells are styled and formatted", checked: currentTarget === 'cell', onClick: () => handleTargetChange('cell') }),
                    React.createElement(TypeRadio_1.TypeRadio, { "data-name": "target-column-header", text: 'Column Header', description: "The Column Header is styled (Note: Conditions are not available for Column Headers)", checked: currentTarget === 'columnHeader', onClick: () => handleTargetChange('columnHeader') }))))));
};
exports.FormatColumnTargetWizardSection = FormatColumnTargetWizardSection;
