import React from 'react'; import { defineMessages, useIntl } from 'react-intl'; import Settings from '/imports/ui/services/settings'; import Styled from '../styles'; import { getNameInitials } from '../service'; import TextInput from '/imports/ui/components/text-input/component'; // @ts-ignore - temporary while settings are still in .js const { animations } = Settings.application; 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(); return ( {getNameInitials(name)} {`[${sequence}] ${name}`} {isGuestLobbyMessageEnabled ? ( ) : null} {isGuestLobbyMessageEnabled ? (

" {privateGuestLobbyMessage && privateGuestLobbyMessage !== '' ? privateGuestLobbyMessage : intl.formatMessage(intlMessages.emptyMessage)} "

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