import classnames from 'classnames'; import StyledWrapper from './StyledWrapper'; import { useDispatch } from 'react-redux'; import { updateSecuritySettingsSelectedTab } from 'providers/ReduxStore/slices/collections/index'; import JSRuntime from './JSRuntime/index'; import AppMode from './AppMode/index'; const SecuritySettings = ({ collection }) => { const dispatch = useDispatch(); const activeTab = collection.securitySettingsSelectedTab || 'appMode'; const selectTab = (tab) => { dispatch( updateSecuritySettingsSelectedTab({ collectionUid: collection.uid, tab }) ); }; const getTabPanel = (tab) => { switch (tab) { case 'appMode': { return ; } case 'jsRuntime': { return ; } default: { return
404 | Not found
; } } }; const getTabClassname = (tabName) => { return classnames(`tab select-none ${tabName}`, { active: tabName === activeTab }); }; return (
selectTab('appMode')}> App Mode
selectTab('jsRuntime')}> JS Runtime
{getTabPanel(activeTab)}
); }; export default SecuritySettings;