mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-29 23:00:08 +02:00

[web] Align online user design to Figma GitOrigin-RevId: 89e09056558d98a57d3c1e5a8409476530784b26
27 lines
806 B
TypeScript
27 lines
806 B
TypeScript
import { useEditorManagerContext } from '@/features/ide-react/context/editor-manager-context'
|
|
import {
|
|
OnlineUser,
|
|
useOnlineUsersContext,
|
|
} from '@/features/ide-react/context/online-users-context'
|
|
import { useCallback } from 'react'
|
|
import { OnlineUsersWidget } from '../online-users/online-users-widget'
|
|
|
|
export const OnlineUsers = () => {
|
|
const { openDoc } = useEditorManagerContext()
|
|
const { onlineUsersArray } = useOnlineUsersContext()
|
|
|
|
const goToUser = useCallback(
|
|
(user: OnlineUser) => {
|
|
if (user.doc && typeof user.row === 'number') {
|
|
openDoc(user.doc, { gotoLine: user.row + 1 })
|
|
}
|
|
},
|
|
[openDoc]
|
|
)
|
|
|
|
return (
|
|
<div className="ide-redesign-online-users">
|
|
<OnlineUsersWidget onlineUsers={onlineUsersArray} goToUser={goToUser} />
|
|
</div>
|
|
)
|
|
}
|