"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ScheduleSettingsReminder = 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 Input_1 = tslib_1.__importDefault(require("../../../../components/Input"));
const CheckBox_1 = require("../../../../components/CheckBox");
const Select_1 = require("../../../../components/Select");
const MESSAGE_TYPES = ['Success', 'Info', 'Warning', 'Error'];
const ScheduleSettingsReminder = (props) => {
    const messageTypes = MESSAGE_TYPES.map((messageType) => ({
        label: messageType,
        value: messageType,
        onClick: () => {
            props.onChange({
                ...props.reminderSchedule,
                MessageType: messageType,
            });
        },
    }));
    const handleHeaderChange = (event) => {
        props.onChange({
            ...props.reminderSchedule,
            Header: event.target?.value,
        });
    };
    const handleMessageChange = (event) => {
        props.onChange({
            ...props.reminderSchedule,
            Message: event.target?.value,
        });
    };
    const handleDisplayNotificationChange = (checked) => {
        props.onChange({
            ...props.reminderSchedule,
            DisplayNotification: checked,
        });
    };
    const handleDisplaySystemStatusChange = (checked) => {
        props.onChange({
            ...props.reminderSchedule,
            DisplaySystemStatusMessage: checked,
        });
    };
    return (React.createElement(rebass_1.Box, { "data-name": "schedule-settings-remainder" },
        React.createElement(Tabs_1.Tabs, { autoFocus: false },
            React.createElement(Tabs_1.Tabs.Tab, null, "Reminder Schedule Settings"),
            React.createElement(Tabs_1.Tabs.Content, null,
                React.createElement(FormLayout_1.default, null,
                    React.createElement(FormLayout_1.FormRow, { label: "Header" },
                        React.createElement(Input_1.default, { "data-name": "header", width: 300, onChange: handleHeaderChange, placeholder: "Enter Reminder Header", type: "string", value: props.reminderSchedule?.Header })),
                    React.createElement(FormLayout_1.FormRow, { label: "Message" },
                        React.createElement(Input_1.default, { "data-name": "message", width: 300, onChange: handleMessageChange, placeholder: "Enter Reminder Message", type: "string", value: props.reminderSchedule?.Message })),
                    React.createElement(FormLayout_1.FormRow, { label: "Type" },
                        React.createElement(rebass_1.Box, { maxWidth: 300 },
                            React.createElement(Select_1.Select, { "data-name": "message-type", placeholder: "Select Option", options: messageTypes, value: props.reminderSchedule?.MessageType, onChange: (value) => {
                                    props.onChange({
                                        ...props.reminderSchedule,
                                        MessageType: value,
                                    });
                                } }))),
                    React.createElement(FormLayout_1.FormRow, { label: "" },
                        React.createElement(CheckBox_1.CheckBox, { "data-name": "display-notification", checked: props.reminderSchedule?.DisplayNotification, onChange: handleDisplayNotificationChange }, "Show the Reminder as a Notification")),
                    React.createElement(FormLayout_1.FormRow, { label: "" },
                        React.createElement(CheckBox_1.CheckBox, { "data-name": "display-system-status", checked: props.reminderSchedule?.DisplaySystemStatusMessage, onChange: handleDisplaySystemStatusChange }, "Display a System Status Message")))))));
};
exports.ScheduleSettingsReminder = ScheduleSettingsReminder;
