// gomuks - A Matrix client written in Go. // Copyright (C) 2024 Tulir Asokan // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . import { RoomViewProps } from "./RoomView.tsx" import "./TimelineEvent.css" export interface TimelineEventProps extends RoomViewProps { eventRowID: number } const TimelineEvent = ({ room, eventRowID }: TimelineEventProps) => { const evt = room.eventsByRowID.get(eventRowID) if (!evt) { return null } // @ts-expect-error TODO add content types const body = (evt.decrypted ?? evt.content).body return
{evt.decrypted_type ?? evt.type}   {evt.sender}   {body ?? {JSON.stringify(evt.decrypted ?? evt.content, null, " ")}}
} export default TimelineEvent