cordis/client/webapp/elements/msg-txt-cont.ts
2021-11-21 20:47:29 -06:00

16 lines
706 B
TypeScript

import * as moment from 'moment';
import { Message } from '../data-types';
import CombinedGuild from '../guild-combined';
import Q from '../q-module.js';
import ElementsUtil from './require/elements-util.js';
export default function createTextMessageContinued(q: Q, guild: CombinedGuild, message: Message): HTMLElement {
return q.create({ class: 'message continued', 'meta-id': message.id, 'meta-member-id': message.member.id, 'meta-guild-id': guild.id, content: [
{ class: 'timestamp', content: moment(message.sent).format('HH:mm') },
{ class: 'right', content: [
{ class: 'content text', content: ElementsUtil.parseMessageText(message.text ?? '') }
] }
] }) as HTMLElement;
}