2023-10-02 05:35:02 -04:00
|
|
|
import LayoutWithPlaceholders from '@/features/ide-react/components/layout/layout-with-placeholders'
|
2023-10-16 07:10:43 -04:00
|
|
|
import { useConnectionContext } from '@/features/ide-react/context/connection-context'
|
|
|
|
import useEventListener from '@/shared/hooks/use-event-listener'
|
|
|
|
import { useCallback, useEffect } from 'react'
|
2023-10-18 05:14:58 -04:00
|
|
|
import { Alerts } from '@/features/ide-react/components/alerts/alerts'
|
2023-10-02 05:35:02 -04:00
|
|
|
|
|
|
|
// This is filled with placeholder content while the real content is migrated
|
|
|
|
// away from Angular
|
|
|
|
export default function IdePage() {
|
2023-10-16 07:10:43 -04:00
|
|
|
const { registerUserActivity } = useConnectionContext()
|
|
|
|
|
|
|
|
// Inform the connection manager when the user is active
|
|
|
|
const listener = useCallback(
|
|
|
|
() => registerUserActivity(),
|
|
|
|
[registerUserActivity]
|
|
|
|
)
|
|
|
|
|
|
|
|
useEventListener('cursor:editor:update', listener)
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
document.body.addEventListener('click', listener)
|
|
|
|
return () => document.body.removeEventListener('click', listener)
|
|
|
|
}, [listener])
|
|
|
|
|
2023-10-02 05:35:02 -04:00
|
|
|
return (
|
2023-10-16 07:10:43 -04:00
|
|
|
<>
|
2023-10-18 05:14:58 -04:00
|
|
|
<Alerts />
|
|
|
|
{/* TODO: Left menu will go here */}
|
2023-10-02 05:35:02 -04:00
|
|
|
<LayoutWithPlaceholders shouldPersistLayout />
|
2023-10-16 07:10:43 -04:00
|
|
|
</>
|
2023-10-02 05:35:02 -04:00
|
|
|
)
|
|
|
|
}
|