/*!
 * Copyright 2017 - 2020 by ChartIQ, Inc.
 * All rights reserved.
 */
import React from "react";
import General from "./components/content/General";
import Workspaces from "./components/content/Workspaces";
import DashbarEditor from "./components/content/DashbarEditor";
import Notifications from "./components/content/Notifications";
import BloombergPreferences from "./components/content/BloombergPreferences";
import { UserPreferencesBase } from "./UserPreferencesBase";
import * as Store from "./stores/UserPreferencesStore";
import { useTitle } from "../../hooks/useTitle";
/**
 * The UserPreferences component initializes the user preference store that's used by its child components and renders
 * its child components: LeftNav and ContentSection with the proper styles.
 */
export const UserPreferences = ({ sections, title }) => {
    const { UserPreferencesStore } = Store;
    const storeSetValue = (arr, val) => UserPreferencesStore.set(arr, val);
    const storeGetValue = (arr, cb) => UserPreferencesStore.get(arr, cb);
    const storeAddListener = (obj, cb) => UserPreferencesStore.addListener(obj, cb);
    const storeRemoveListener = (obj, cb) => UserPreferencesStore.removeListener(obj, cb);
    useTitle(title !== null && title !== void 0 ? title : "User Preferences");
    return (React.createElement(UserPreferencesBase, { sections: sections, setValue: storeSetValue, getValue: storeGetValue, addListener: storeAddListener, removeListener: storeRemoveListener }));
};
export { General, Workspaces, DashbarEditor, Notifications, BloombergPreferences };
//# sourceMappingURL=UserPreferences.js.map