diff --git a/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantListItem.tsx b/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantListItem.tsx index 63232694..ba8344b7 100644 --- a/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantListItem.tsx +++ b/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantListItem.tsx @@ -1,10 +1,11 @@ import { css } from '@/styled-system/css' -import { HStack } from '@/styled-system/jsx' +import { HStack, VStack } from '@/styled-system/jsx' import { Text } from '@/primitives/Text' import { useTranslation } from 'react-i18next' import { Avatar } from '@/components/Avatar' import { getParticipantColor } from '@/features/rooms/utils/getParticipantColor' +import { getParticipantIsRoomAdmin } from '@/features/rooms/utils/getParticipantIsRoomAdmin' import { Participant, Track } from 'livekit-client' import { isLocal } from '@/utils/livekit' import { @@ -102,36 +103,41 @@ export const ParticipantListItem = ({ > - - + - {name} - - {isLocal(participant) && ( - ({t('participants.you')}) + {name} + {isLocal(participant) && ( + + ({t('participants.you')}) + + )} + + {getParticipantIsRoomAdmin(participant) && ( + {t('participants.host')} )} - + diff --git a/src/frontend/src/features/rooms/utils/getParticipantIsRoomAdmin.ts b/src/frontend/src/features/rooms/utils/getParticipantIsRoomAdmin.ts new file mode 100644 index 00000000..a0ee52b5 --- /dev/null +++ b/src/frontend/src/features/rooms/utils/getParticipantIsRoomAdmin.ts @@ -0,0 +1,12 @@ +import { Participant } from 'livekit-client' + +export const getParticipantIsRoomAdmin = ( + participant: Participant +): boolean => { + const attributes = participant.attributes + + if (!attributes) { + return false + } + return attributes?.room_admin === 'true' +} diff --git a/src/frontend/src/locales/de/rooms.json b/src/frontend/src/locales/de/rooms.json index a6bed7ef..1a8db979 100644 --- a/src/frontend/src/locales/de/rooms.json +++ b/src/frontend/src/locales/de/rooms.json @@ -426,6 +426,7 @@ "participants": { "subheading": "Im Raum", "you": "Du", + "host": "Host", "contributors": "Mitwirkende", "collapsable": { "open": "{{name}}-Liste öffnen", diff --git a/src/frontend/src/locales/en/rooms.json b/src/frontend/src/locales/en/rooms.json index 652ec1d2..fd401d7c 100644 --- a/src/frontend/src/locales/en/rooms.json +++ b/src/frontend/src/locales/en/rooms.json @@ -426,6 +426,7 @@ "participants": { "subheading": "In room", "you": "You", + "host": "Host", "contributors": "Contributors", "collapsable": { "open": "Open {{name}} list", diff --git a/src/frontend/src/locales/fr/rooms.json b/src/frontend/src/locales/fr/rooms.json index 72e75d85..ebc1bd48 100644 --- a/src/frontend/src/locales/fr/rooms.json +++ b/src/frontend/src/locales/fr/rooms.json @@ -427,6 +427,7 @@ "subheading": "Dans la réunion", "you": "Vous", "contributors": "Contributeurs", + "host": "Organisateur de la réunion", "collapsable": { "open": "Ouvrir la liste {{name}}", "close": "Fermer la liste {{name}}" diff --git a/src/frontend/src/locales/nl/rooms.json b/src/frontend/src/locales/nl/rooms.json index 42877d2b..b44d56a1 100644 --- a/src/frontend/src/locales/nl/rooms.json +++ b/src/frontend/src/locales/nl/rooms.json @@ -426,6 +426,7 @@ "participants": { "subheading": "In de ruimte", "you": "U", + "host": "Host", "contributors": "Deelnemers", "collapsable": { "open": "Open {{name}} lijst",