import { createSignal, Show } from 'solid-js' import { clsx } from 'clsx' import styles from './Message.module.scss' import DialogAvatar from './DialogAvatar' import type { Message as MessageType, ChatMember } from '../../graphql/types.gen' import { Icon } from '../_shared/Icon' import { MessageActionsPopup } from './MessageActionsPopup' import QuotedMessage from './QuotedMessage' import { useLocalize } from '../../context/localize' type Props = { content: MessageType ownId: number members: ChatMember[] replyClick?: () => void replyBody?: string replyAuthor?: string } export const Message = (props: Props) => { const { formatTime } = useLocalize() const isOwn = props.ownId === Number(props.content.author) const user = props.members?.find((m) => m.id === Number(props.content.author)) const [isPopupVisible, setIsPopupVisible] = createSignal(false) return (
{user.name}
setIsPopupVisible(isVisible)} trigger={} />
{formatTime(new Date(props.content.createdAt * 1000))}
) }