"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ScheduleSettingsOpenFin = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const rebass_1 = require("rebass");
const Tabs_1 = require("../../../../components/Tabs");
const FormLayout_1 = tslib_1.__importStar(require("../../../../components/FormLayout"));
const DropdownButton_1 = tslib_1.__importDefault(require("../../../../components/DropdownButton"));
const ScheduleSettingsOpenFin = (props) => {
    const reportOptions = props.allReports.map((report) => ({
        label: report.Name,
        value: report.Name,
        onClick: () => props.onChange({
            ...props.openFin,
            OpenFinReport: {
                ...props.openFin.OpenFinReport,
                ReportName: report.Name,
            },
        }),
    }));
    return (React.createElement(rebass_1.Box, { "data-name": "schedule-settings-openfin" },
        React.createElement(Tabs_1.Tabs, { autoFocus: false },
            React.createElement(Tabs_1.Tabs.Tab, null, "OpenFin Schedule Settings"),
            React.createElement(Tabs_1.Tabs.Content, null,
                React.createElement(FormLayout_1.default, null,
                    React.createElement(FormLayout_1.FormRow, { label: "Select Report" },
                        React.createElement(DropdownButton_1.default, { "data-name": "select-report", columns: ['label'], style: { width: 300 }, disabled: props.allReports.length == 0, items: reportOptions }, props?.openFin?.OpenFinReport?.ReportName || 'Select Report')))))));
};
exports.ScheduleSettingsOpenFin = ScheduleSettingsOpenFin;
