import React from 'react'; import { defineMessages, useIntl } from 'react-intl'; import { getSettingsSingletonInstance } from '/imports/ui/services/settings'; import Styled from '../styles'; import { getNameInitials } from '../service'; import TextInput from '/imports/ui/components/text-input/component'; const intlMessages = defineMessages({ accept: { id: 'app.userList.guest.acceptLabel', description: 'Accept guest button label', }, privateMessageLabel: { id: 'app.userList.guest.privateMessageLabel', description: 'Private message button label', }, deny: { id: 'app.userList.guest.denyLabel', description: 'Deny guest button label', }, privateInputPlaceholder: { id: 'app.userList.guest.privateInputPlaceholder', description: 'Private input placeholder', }, emptyMessage: { id: 'app.userList.guest.emptyMessage', description: 'Empty guest lobby message label', }, }); const renderGuestUserItem = ( name: string, color: string, handleAccept: ()=>void, handleDeny: ()=>void, role: string, sequence: number, userId: string, avatar: string, privateMessageVisible: ()=>void, setPrivateGuestLobbyMessage: (msg: string) => void, privateGuestLobbyMessage: string, isGuestLobbyMessageEnabled: boolean, ) => { const intl = useIntl(); const Settings = getSettingsSingletonInstance(); const animations = Settings?.application?.animations; return ( {getNameInitials(name)} {`[${sequence}] ${name}`} {isGuestLobbyMessageEnabled ? ( ) : null} {isGuestLobbyMessageEnabled ? (

" {privateGuestLobbyMessage && privateGuestLobbyMessage !== '' // eslint-disable-next-line react/no-danger ? : intl.formatMessage(intlMessages.emptyMessage)} "

) : null}
); }; export default renderGuestUserItem;