import type { ChatMember, Message as MessageType } from '../../graphql/schema/chat.gen' import { clsx } from 'clsx' import { Show, createSignal } from 'solid-js' import { useLocalize } from '../../context/localize' import { Icon } from '../_shared/Icon' import DialogAvatar from './DialogAvatar' import { MessageActionsPopup } from './MessageActionsPopup' import QuotedMessage from './QuotedMessage' import styles from './Message.module.scss' 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.created_by) const user = props.members?.find((m) => m.id === Number(props.content.created_by)) const [isPopupVisible, setIsPopupVisible] = createSignal(false) return (
{user?.name}
setIsPopupVisible(isVisible)} trigger={} />
{formatTime(new Date(props.content.created_at * 1000))}
) }