"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 Tabs_1 = require("../../../../components/Tabs");
const FormLayout_1 = tslib_1.__importStar(require("../../../../components/FormLayout"));
const Input_1 = tslib_1.__importDefault(require("../../../../components/Input"));
const DropdownButton_1 = tslib_1.__importDefault(require("../../../../components/DropdownButton"));
const Flex_1 = require("../../../../components/Flex");
const ScheduleSettingsOpenFin = (props) => {
    const handleNameChange = (event) => {
        props.onChange({
            ...props.openFin,
            Name: event.target.value,
        });
    };
    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(Flex_1.Box, { "data-name": "schedule-settings-openfin" },
        React.createElement(Tabs_1.Tabs, { autoFocus: false },
            React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
            React.createElement(Tabs_1.Tabs.Content, null,
                React.createElement(FormLayout_1.default, null,
                    React.createElement(FormLayout_1.FormRow, { label: "Name" },
                        React.createElement(Input_1.default, { "data-name": "schedule-name", className: "twa:w-[300px]", onChange: handleNameChange, placeholder: "Enter Schedule Name", type: "string", value: props.openFin?.Name ?? '' })),
                    React.createElement(FormLayout_1.FormRow, { label: "" },
                        React.createElement(Flex_1.Box, { className: "twa:h-2" })),
                    React.createElement(FormLayout_1.FormRow, { label: "Select Report" },
                        React.createElement(DropdownButton_1.default, { "data-name": "select-report", columns: ['label'], className: "twa:w-[300px]", disabled: props.allReports.length == 0, items: reportOptions }, props?.openFin?.OpenFinReport?.ReportName || 'Select Report')))))));
};
exports.ScheduleSettingsOpenFin = ScheduleSettingsOpenFin;
