import * as React from 'react';
import { Tabs } from '../../../../components/Tabs';
import FormLayout, { FormRow } from '../../../../components/FormLayout';
import Input from '../../../../components/Input';
import DropdownButton from '../../../../components/DropdownButton';
import { Box } from '../../../../components/Flex';
export 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(Box, { "data-name": "schedule-settings-openfin" },
        React.createElement(Tabs, { autoFocus: false },
            React.createElement(Tabs.Tab, null, "Settings"),
            React.createElement(Tabs.Content, null,
                React.createElement(FormLayout, null,
                    React.createElement(FormRow, { label: "Name" },
                        React.createElement(Input, { "data-name": "schedule-name", className: "twa:w-[300px]", onChange: handleNameChange, placeholder: "Enter Schedule Name", type: "string", value: props.openFin?.Name ?? '' })),
                    React.createElement(FormRow, { label: "" },
                        React.createElement(Box, { className: "twa:h-2" })),
                    React.createElement(FormRow, { label: "Select Report" },
                        React.createElement(DropdownButton, { "data-name": "select-report", columns: ['label'], className: "twa:w-[300px]", disabled: props.allReports.length == 0, items: reportOptions }, props?.openFin?.OpenFinReport?.ReportName || 'Select Report')))))));
};
