1 import { DateTime } from "luxon";
2 import { MessageWithNames } from "../repository/mail";
4 export function renderMailroom(mail: MessageWithNames[]): string {
14 <tr class="${msg.read_at === 0 ? 'unread': 'read'}" >
15 <td>${msg.username}</td>
17 <a href="#" hx-trigger="click" hx-get="/messages/${msg.id}" hx-target="#individual-message">
21 <td>${DateTime.fromMillis(msg.sent_at)}</td>
26 <div id="individual-message"></div>
30 export function renderMessage(msg: MessageWithNames): string {
35 <td>${msg.username}</td>
39 <td>${DateTime.fromMillis(msg.sent_at)}</td>
43 <td>${msg.subject}</td>
46 <th valign="top">Message</th>
47 <td>${msg.message}</td>