import { MessageAndDropdown } from './message-and-dropdown' import { useTranslation } from 'react-i18next' import type { Message as MessageType } from '@/features/chat/context/chat-context' import { User } from '../../../../../types/user' export interface MessageGroupProps { messages: MessageType[] user?: User fromSelf: boolean } function MessageGroup({ messages, user, fromSelf }: MessageGroupProps) { const { t } = useTranslation() return (
{!fromSelf && (
{user?.id && user.email ? user.first_name || user.email : t('deleted_user')}
)}
{messages.map(message => { const nonDeletedMessages = messages.filter(m => !m.deleted) const nonDeletedIndex = nonDeletedMessages.findIndex( m => m.id === message.id ) return ( ) })}
) } export default MessageGroup