feat: add live users avatar indicators

This commit is contained in:
swve 2024-04-05 00:49:14 +02:00
parent 54718d7111
commit 6a47202c78
5 changed files with 100 additions and 15 deletions

View file

@ -1,5 +1,6 @@
import { m, motion } from "framer-motion";
import React from 'react'
import { getCollaborationServerUrl } from "@services/config/config";
import { motion } from "framer-motion";
import React, { useEffect } from 'react'
interface User {
user_uuid: string;
@ -18,12 +19,24 @@ interface Movement {
interface MouseMovementsProps {
movements: Record<string, Movement>;
onlinePageInstanceID: string;
org ?: any;
}
function MouseMovements({ movements, onlinePageInstanceID }: MouseMovementsProps): JSX.Element {
function MouseMovements({ movements, onlinePageInstanceID, org }: MouseMovementsProps): JSX.Element {
/* Collaboration config */
const collab = getCollaborationServerUrl()
const isCollabEnabledOnThisOrg = org?.config.config.GeneralConfig.collaboration && collab
useEffect(() => {
}
, [movements, org]);
return (
<div>
{Object.keys(movements).map((key) => (
{isCollabEnabledOnThisOrg && Object.keys(movements).map((key) => (
movements[key].onlinePageInstanceID !== onlinePageInstanceID && (<motion.div
key={key}
className="flex -space-x-2"