"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) => {
    var _a, _b, _c, _d, _e;
    const messageTypes = MESSAGE_TYPES.map((messageType) => ({
        label: messageType,
        value: messageType,
        onClick: () => {
            props.onChange(Object.assign(Object.assign({}, props.reminderSchedule), { MessageType: messageType }));
        },
    }));
    const handleHeaderChange = (event) => {
        var _a;
        props.onChange(Object.assign(Object.assign({}, props.reminderSchedule), { Header: (_a = event.target) === null || _a === void 0 ? void 0 : _a.value }));
    };
    const handleMessageChange = (event) => {
        var _a;
        props.onChange(Object.assign(Object.assign({}, props.reminderSchedule), { Message: (_a = event.target) === null || _a === void 0 ? void 0 : _a.value }));
    };
    const handleDisplayNotificationChange = (checked) => {
        props.onChange(Object.assign(Object.assign({}, props.reminderSchedule), { DisplayNotification: checked }));
    };
    const handleDisplaySystemStatusChange = (checked) => {
        props.onChange(Object.assign(Object.assign({}, 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: (_a = props.reminderSchedule) === null || _a === void 0 ? void 0 : _a.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: (_b = props.reminderSchedule) === null || _b === void 0 ? void 0 : _b.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: (_c = props.reminderSchedule) === null || _c === void 0 ? void 0 : _c.MessageType, onChange: (value) => {
                                    props.onChange(Object.assign(Object.assign({}, props.reminderSchedule), { MessageType: value }));
                                } }))),
                    React.createElement(FormLayout_1.FormRow, { label: "" },
                        React.createElement(CheckBox_1.CheckBox, { "data-name": "display-notification", checked: (_d = props.reminderSchedule) === null || _d === void 0 ? void 0 : _d.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: (_e = props.reminderSchedule) === null || _e === void 0 ? void 0 : _e.DisplaySystemStatusMessage, onChange: handleDisplaySystemStatusChange }, "Display a System Status Message")))))));
};
exports.ScheduleSettingsReminder = ScheduleSettingsReminder;
