import React, { useState } from "react";
// Types
// Context
import { NotificationsPreferencesContext, } from "../../NotificationsPreferencesContext";
// Components
import NotificationsPreferencesHome from "./notificationViews/NotificationsPreferencesHome";
import NotificationsSourcesPreferences from "./notificationViews/NotificationsSourcesPreferences";
import NotificationsSourceTypes from "./notificationViews/NotificationsSourceTypes";
const renderView = (viewName) => {
    switch (viewName) {
        case "Home":
            return React.createElement(NotificationsPreferencesHome, null);
        case "Sources":
            return React.createElement(NotificationsSourcesPreferences, null);
        case "Details":
            return React.createElement(NotificationsSourceTypes, null);
        default:
            return;
    }
};
export default function Notifications() {
    // Notification preferences not available under iocd. These can now be set from the notifications panel.
    if (window.glue42gd) {
        return React.createElement("div", null, "Use settings in notifications panel when running under io.Connect");
    }
    const [currentView, setCurrentView] = useState("Home");
    const [selectedNotificationSource, setSelectedNotificationSource] = useState(null);
    const [notificationSources, setNotificationSources] = useState([]);
    const notificationsPreferencesContextValues = {
        currentNotificationsPreferencesView: currentView,
        setCurrentNotificationsPreferencesView: setCurrentView,
        selectedNotificationSource: selectedNotificationSource,
        setSelectedNotificationSource: setSelectedNotificationSource,
        notificationSources: notificationSources,
        setNotificationSources: setNotificationSources,
    };
    return (React.createElement("div", { className: "notifications-main-preferences__container" },
        React.createElement(NotificationsPreferencesContext.Provider, { value: notificationsPreferencesContextValues }, renderView(currentView))));
}
//# sourceMappingURL=Notifications.js.map