diff --git a/src/frontend/src/features/rooms/livekit/components/MutedMicIndicator.tsx b/src/frontend/src/features/rooms/livekit/components/MutedMicIndicator.tsx new file mode 100644 index 00000000..07e94e9a --- /dev/null +++ b/src/frontend/src/features/rooms/livekit/components/MutedMicIndicator.tsx @@ -0,0 +1,26 @@ +import { useTrackMutedIndicator } from '@livekit/components-react' +import { Participant, Track } from 'livekit-client' +import Source = Track.Source +import { Div } from '@/primitives' +import { RiMicOffFill } from '@remixicon/react' + +export const MutedMicIndicator = ({ + participant, +}: { + participant: Participant +}) => { + const { isMuted } = useTrackMutedIndicator({ + participant: participant, + source: Source.Microphone, + }) + + if (!isMuted) { + return null + } + + return ( +
+ +
+ ) +} diff --git a/src/frontend/src/features/rooms/livekit/components/ParticipantTile.tsx b/src/frontend/src/features/rooms/livekit/components/ParticipantTile.tsx index aefa2e61..1c9f9b77 100644 --- a/src/frontend/src/features/rooms/livekit/components/ParticipantTile.tsx +++ b/src/frontend/src/features/rooms/livekit/components/ParticipantTile.tsx @@ -6,7 +6,6 @@ import { ParticipantName, ParticipantTileProps, ScreenShareIcon, - TrackMutedIndicator, useEnsureTrackRef, useFeatureContext, useIsEncrypted, @@ -27,6 +26,8 @@ import { Track } from 'livekit-client' import { ParticipantPlaceholder } from '@/features/rooms/livekit/components/ParticipantPlaceholder' import { RiHand } from '@remixicon/react' import { useRaisedHand } from '@/features/rooms/livekit/hooks/useRaisedHand' +import { HStack } from '@/styled-system/jsx' +import { MutedMicIndicator } from '@/features/rooms/livekit/components/MutedMicIndicator' export function TrackRefContextIfNeeded( props: React.PropsWithChildren<{ @@ -119,48 +120,44 @@ export const ParticipantTile: ( />
-
- {trackReference.source === Track.Source.Camera ? ( - <> - {isHandRaised && ( - - )} - {isEncrypted && ( - - )} - - - - ) : ( - <> - - 's screen - - )} -
+ + +
+ {trackReference.source === Track.Source.Camera ? ( + <> + {isHandRaised && ( + + )} + {isEncrypted && ( + + )} + + + ) : ( + <> + + 's screen + + )} +
+