| 1 | export { theme } from "../tags/question-layout.marko"; |
| 2 | import { PendingQuestion } from "#src/q+a/models/PendingQuestion.ts"; |
| 3 | import { |
| 4 | formatQuestionISOTimestamp, |
| 5 | formatQuestionTimestamp, |
| 6 | } from "#src/q+a/format.ts"; |
| 7 | export const meta = { title: "question answer inbox" }; |
| 8 | |
| 9 | <const/questions=PendingQuestion.getAll()> |
| 10 | |
| 11 | <question-layout minimal> |
| 12 | <h1>inbox</h1> |
| 13 | <for|q| of=questions> |
| 14 | <div |
| 15 | data-q=q.id |
| 16 | style="border-bottom: 2px solid #fff7; margin-bottom: 1rem" |
| 17 | > |
| 18 | <time datetime=formatQuestionISOTimestamp(q.date)> |
| 19 | ${formatQuestionTimestamp(q.date)} ${q.id} |
| 20 | </time> |
| 21 | <div style="color: dodgerblue; margin-bottom: 0.25rem"> |
| 22 | ${q.sourceName}${ |
| 23 | q.sourceLocation !== "unknown" ? `from ${q.sourceLocation}` : "" |
| 24 | }${q.sourceVPN ? `(VPN: ${q.sourceVPN})` : ""} |
| 25 | </div> |
| 26 | <p style="white-space: pre-wrap">${q.prompt}</p> |
| 27 | <p> |
| 28 | <button onclick=`onReply("${q.id}")` style="color: lime">reply</button> |
| 29 | <button onclick=`onDelete("${q.id}")` style="color: red">reject</button> |
| 30 | <button onclick=`onDeleteFull("${q.id}")` style="color: red"> |
| 31 | DELETE |
| 32 | </button> |
| 33 | </p> |
| 34 | </div> |
| 35 | </for> |
| 36 | </question-layout> |
| 37 | |
| 38 | client import "./backend-inbox.client.ts"; |