2022-11-10 15:06:02 +00:00
|
|
|
|
import styles from './DialogCard.module.scss'
|
|
|
|
|
import DialogAvatar from './DialogAvatar'
|
2022-11-27 18:08:11 +00:00
|
|
|
|
import type { Author, Chat, ChatMember, User } from '../../graphql/types.gen'
|
2022-11-15 09:45:55 +00:00
|
|
|
|
import { apiClient } from '../../utils/apiClient'
|
2022-11-25 23:34:46 +00:00
|
|
|
|
import { t } from '../../utils/intl'
|
|
|
|
|
import { useInbox } from '../../context/inbox'
|
2022-11-10 15:06:02 +00:00
|
|
|
|
|
2022-11-15 12:15:07 +00:00
|
|
|
|
type DialogProps = {
|
2022-11-10 15:06:02 +00:00
|
|
|
|
online?: boolean
|
|
|
|
|
message?: string
|
|
|
|
|
counter?: number
|
2022-11-27 18:08:11 +00:00
|
|
|
|
theme?: string
|
2022-11-27 11:45:36 +00:00
|
|
|
|
ownSlug: string
|
2022-11-27 18:08:11 +00:00
|
|
|
|
members: ChatMember[]
|
2022-11-15 09:45:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-15 12:15:07 +00:00
|
|
|
|
const DialogCard = (props: DialogProps) => {
|
2022-11-27 18:08:11 +00:00
|
|
|
|
const companions = props.members.filter((member) => member.slug !== props.ownSlug)
|
2022-11-27 11:45:36 +00:00
|
|
|
|
console.log('!!! companions:', companions)
|
2022-11-10 15:06:02 +00:00
|
|
|
|
return (
|
2022-11-27 05:49:48 +00:00
|
|
|
|
<div class={styles.DialogCard}>
|
2022-11-27 07:10:04 +00:00
|
|
|
|
<div class={styles.avatar}>{/*<DialogAvatar name={participants[0]} online={props.online} />*/}</div>
|
2022-11-10 15:58:43 +00:00
|
|
|
|
<div class={styles.row}>
|
2022-11-27 18:08:11 +00:00
|
|
|
|
{companions.length > 1 ? <div>Group</div> : <div class={styles.name}>{companions[0].name}</div>}
|
2022-11-10 15:06:02 +00:00
|
|
|
|
<div class={styles.message}>
|
|
|
|
|
Указать предпочтительные языки для результатов поиска можно в разделе
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class={styles.activity}>
|
|
|
|
|
<div class={styles.time}>22:22</div>
|
|
|
|
|
<div class={styles.counter}>
|
|
|
|
|
<span>12</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default DialogCard
|