import { Handlers, PageProps } from "$fresh/server.ts"; import { Database, Option } from "types"; import { get_db_obj } from "db"; import Interactive from "../../../islands/Interactive.tsx"; export const handler: Handlers> = { async GET(req, ctx) { const db = await get_db_obj(); if ( db.isNone() || (db.isSome() && !db.unwrap().conversations[ctx.params.conversation_id]) ) { return ctx.renderNotFound(); } return ctx.render(db); }, }; export default function ConversationPreview({ data, params, }: PageProps>) { if ( data.isSome() && params.conversation_id && data.unwrap().conversations[params.conversation_id] ) { return ; } } //TODO: keyboard shortcut (advertised elsewhere) that activates interactive mode