import React, { useCallback, useContext } from 'react';
export var PerspectivesSettingsContext = React.createContext({
    settings: {},
    onChange: function () { }
});
PerspectivesSettingsContext.displayName = 'PerspectivesSettingsContext';
export var usePerspectivesSettings = function (perspectiveId) {
    var _a = useContext(PerspectivesSettingsContext) || {}, settings = _a.settings, onChange = _a.onChange;
    var perspectiveSettings = settings === null || settings === void 0 ? void 0 : settings[perspectiveId];
    var updatePerspectiveSettings = useCallback(function (newSetting) {
        onChange(perspectiveId, newSetting);
    }, [perspectiveId, onChange]);
    return { updatePerspectiveSettings: updatePerspectiveSettings, perspectiveSettings: perspectiveSettings };
};
