import React, { useEffect } from 'react'; import { useAuth } from '../../hooks/useAuth'; import { isStudioMode } from '../../services/apiUtils'; import MainContainer from '../../containers/MainContainer'; import WorkspaceView from './WorkspaceView'; /** * WorkspaceContainer handles the 'Smart' logic: * - Authentication state monitoring * - Redirections * - Data fetching/preparation for the View */ const WorkspaceContainer: React.FC = () => { const { authState, user, workspaceUrl, signOutUrl } = useAuth(); useEffect(() => { if (authState === 'unauthorized' && !isStudioMode()) { window.location.href = '/home/login'; } }, [authState]); if (authState === 'checking') { return (

Verifying access...

); } if (authState === 'unauthorized' && isStudioMode()) { return (

Unauthorized

You do not have permission to access this application.

); } return ( ); }; export default WorkspaceContainer;