"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ScheduleSettingsReport = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const rebass_1 = require("rebass");
const FormLayout_1 = tslib_1.__importStar(require("../../../../components/FormLayout"));
const Select_1 = require("../../../../components/Select");
const Tabs_1 = require("../../../../components/Tabs");
const ScheduleSettingsReport = (props) => {
    const reportOptions = props.allReports.map((report) => ({
        label: report.Name,
        value: report.Name,
    }));
    const formatOptions = props.allFormats.map((reportFormat) => ({
        label: reportFormat,
        value: reportFormat,
        onClick: () => {
            props.onChange({
                ...props.report,
                ReportFormat: reportFormat,
            });
        },
    }));
    const destinationOptions = props.allDestinations.map((destination) => ({
        label: destination,
        value: destination,
        onClick: () => {
            props.onChange({
                ...props.report,
                ExportDestination: destination,
            });
        },
    }));
    return (React.createElement(rebass_1.Box, { "data-name": "schedule-settings-report" },
        React.createElement(Tabs_1.Tabs, { autoFocus: false, mb: 3 },
            React.createElement(Tabs_1.Tabs.Tab, null, "Report Settings"),
            React.createElement(Tabs_1.Tabs.Content, null,
                React.createElement(FormLayout_1.default, null,
                    React.createElement(FormLayout_1.FormRow, { label: "Export" },
                        React.createElement(rebass_1.Box, { maxWidth: 300 },
                            React.createElement(Select_1.Select, { "data-name": "select-report", options: reportOptions, value: props?.report?.ReportName, placeholder: "Select Export", onChange: (value) => props.onChange({
                                    ...props.report,
                                    ReportName: value,
                                }) }))),
                    React.createElement(FormLayout_1.FormRow, { label: "Format" },
                        React.createElement(rebass_1.Box, { maxWidth: 300 },
                            React.createElement(Select_1.Select, { "data-name": "select-format", options: formatOptions, value: props?.report?.ReportFormat, placeholder: "Select Format", onChange: (value) => props.onChange({
                                    ...props.report,
                                    ReportFormat: value,
                                }) }))),
                    React.createElement(FormLayout_1.FormRow, { label: "Destination" },
                        React.createElement(rebass_1.Box, { maxWidth: 300 },
                            React.createElement(Select_1.Select, { "data-name": "select-destination", options: destinationOptions, value: props?.report?.ExportDestination, placeholder: "Select Format", onChange: (value) => props.onChange({
                                    ...props.report,
                                    ExportDestination: value,
                                }) }))))))));
};
exports.ScheduleSettingsReport = ScheduleSettingsReport;
