|
|
@@ -15,6 +15,7 @@ import { UserContact, api } from './services/api'
|
|
|
import { logger } from './utils/logger'
|
|
|
import { formatFullDateTime } from './utils/timeUtils'
|
|
|
import { formatApiMessageToMessage } from './utils/formatMessage'
|
|
|
+import { formatConversationRemark } from './utils/conversationRemark'
|
|
|
import { getDefaultAvatar, getSessionAvatar } from './utils/avatarUtils'
|
|
|
import { Contact, Message, SearchResult } from './types'
|
|
|
|
|
|
@@ -411,7 +412,8 @@ function App(): JSX.Element {
|
|
|
avatar: getSessionAvatar(contact.id, contact.name || contact.english_name, 40),
|
|
|
lastMessage: undefined,
|
|
|
lastMessageTime: undefined,
|
|
|
- unreadCount: 0
|
|
|
+ unreadCount: 0,
|
|
|
+ remarks: undefined
|
|
|
}
|
|
|
|
|
|
setContacts(prev => [newContact, ...prev])
|
|
|
@@ -585,7 +587,9 @@ function App(): JSX.Element {
|
|
|
)}
|
|
|
</div>
|
|
|
<div style={{ flex: 1, overflowY: 'auto' }}>
|
|
|
- {contacts.map(contact => (
|
|
|
+ {contacts.map(contact => {
|
|
|
+ const remarkLabel = formatConversationRemark(contact.remarks)
|
|
|
+ return (
|
|
|
<div
|
|
|
key={contact.id}
|
|
|
className={`contact-item ${contact.id === activeContactId ? 'active' : ''}`}
|
|
|
@@ -626,7 +630,25 @@ function App(): JSX.Element {
|
|
|
</div>
|
|
|
<div style={{ flex: 1, overflow: 'hidden', display: 'flex', flexDirection: 'column', justifyContent: 'center' }}>
|
|
|
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '4px' }}>
|
|
|
- <span style={{ fontWeight: '500', fontSize: '14px', color: '#000' }}>{contact.name}</span>
|
|
|
+ <div style={{ display: 'flex', alignItems: 'center', flex: 1, marginRight: '8px', flexWrap: 'wrap' }}>
|
|
|
+ <span style={{ fontWeight: '500', fontSize: '14px', color: '#000' }}>
|
|
|
+ {contact.name}
|
|
|
+ </span>
|
|
|
+ {remarkLabel && (
|
|
|
+ <span
|
|
|
+ style={{
|
|
|
+ fontSize: '11px',
|
|
|
+ color: '#d97706',
|
|
|
+ marginLeft: '2px',
|
|
|
+ whiteSpace: 'nowrap',
|
|
|
+ display: 'inline-block'
|
|
|
+ }}
|
|
|
+ title={remarkLabel}
|
|
|
+ >
|
|
|
+ {remarkLabel}
|
|
|
+ </span>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
<span style={{ fontSize: '10px', color: '#999' }}>{contact.lastMessageTime}</span>
|
|
|
</div>
|
|
|
<div style={{ fontSize: '12px', color: '#888', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
|
|
|
@@ -634,7 +656,8 @@ function App(): JSX.Element {
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- ))}
|
|
|
+ )
|
|
|
+ })}
|
|
|
</div>
|
|
|
</>
|
|
|
)
|