1 import { DateTime } from "luxon";
2 import { MessageWithNames } from "../repository/mail";
3 import { topbar } from "./topbar";
5 export function renderMailroom(mail: MessageWithNames[]): string {
7 <div hx-trigger="every 600s" hx-get="/poll/mailroom">
8 <h2 data-augmented-ui="tl-clip bl-clip none">Mail</h2>
17 <tr class="${msg.read_at === 0 ? 'unread': 'read'}" >
18 <td>${msg.username}</td>
20 <a href="#" hx-trigger="click" hx-get="/messages/${msg.id}" hx-target="#individual-message">
24 <td>${DateTime.fromMillis(msg.sent_at)}</td>
29 <div id="individual-message"></div>
34 export function renderMessage(msg: MessageWithNames): string {
39 <td>${msg.username}</td>
43 <td>${DateTime.fromMillis(msg.sent_at)}</td>
47 <td>${msg.subject}</td>
50 <th valign="top">Message</th>
51 <td>${msg.message}</td>