diff --git a/packages/desktop/src/tree/protected/terminal/panels/MainPanel.tsx b/packages/desktop/src/tree/protected/terminal/panels/MainPanel.tsx
index e2bc839..332915c 100644
--- a/packages/desktop/src/tree/protected/terminal/panels/MainPanel.tsx
+++ b/packages/desktop/src/tree/protected/terminal/panels/MainPanel.tsx
@@ -1,11 +1,25 @@
-import React from 'react';
+import React, { useMemo } from 'react';
import useAuth from '../../../../providers/AuthProvider';
import useRealTimeRooms from '../../../../providers/RealTimeRoomProvider';
+import { LineMemberState } from '@nirvana/core/models/line.model';
+import LineIcon from '../../../../components/lineIcon';
+import { FiActivity, FiHeadphones, FiSettings, FiSun } from 'react-icons/fi';
+import { Avatar, Tooltip } from 'antd';
+
export default function MainPanel() {
const { user } = useAuth();
- const { roomsMap } = useRealTimeRooms();
+ const { selectedLineId } = useRealTimeRooms();
+
+ // already won't see stuff for overlay only mode as per parent configuration
+
+ // TODO: if there is stuff in search, show that first
+
+ // if selected line, show line details
+ if (selectedLineId) return ;
+
+ // else show the stale state
return (
);
}
+
+function LineDetails() {
+ const { user } = useAuth();
+
+ const { selectedLineId, roomsMap, handleUpdateLineMemberState } = useRealTimeRooms();
+
+ const selectedLine = useMemo(() => roomsMap[selectedLineId], [selectedLineId, roomsMap]);
+
+ console.log('selected line', selectedLine);
+
+ const isUserToggleTuned = useMemo(
+ () => selectedLine?.currentUserMember?.state === LineMemberState.TUNED,
+ [selectedLine],
+ );
+
+ // seeing if I am in the list of broadcasters
+ // the source of truth from the socket connections telling me if my clicking actually made a round trip
+ const isUserBroadcasting = useMemo(
+ () => selectedLine?.currentBroadcastersUserIds?.includes(user._id.toString()),
+ [user, selectedLine],
+ );
+
+ // showing all tuned in members...they may not hear me since they might be doing something else
+ // but feeling of presentness
+ const tunedProfiles = useMemo(() => {
+ const pictureSources: { name: string; pictureSrc: string }[] = [];
+
+ selectedLine.tunedInMemberIds?.forEach((tunedInMemberUserId) => {
+ // don't want to see my own picture
+ // TODO: don't show myself!?
+ if (tunedInMemberUserId === user._id.toString()) {
+ pictureSources.push();
+
+ pictureSources.push({
+ name: user.givenName,
+ pictureSrc: user.picture,
+ });
+ return;
+ }
+
+ const otherUserObject = selectedLine.otherUserObjects?.find(
+ (userObj) => userObj._id.toString() === tunedInMemberUserId,
+ );
+ if (otherUserObject?.picture)
+ pictureSources.push({
+ name: otherUserObject.givenName,
+ pictureSrc: otherUserObject.picture,
+ });
+ });
+
+ return pictureSources;
+ }, [selectedLine, user]);
+
+ // pics for the line icons
+ const profilePictures = useMemo(() => {
+ const pictureSources: string[] = [];
+
+ // ?don't add in my image as that's useless contextually?
+ // if (userData?.user?.picture) pictureSources.push(userData.user.picture);
+
+ selectedLine.otherUserObjects?.forEach((otherUser) => {
+ if (otherUser.picture) pictureSources.push(otherUser.picture);
+ });
+
+ return pictureSources;
+ }, [selectedLine, user]);
+
+ return (
+