import { useState } from "preact/hooks";
import { Database } from "types";
import { Head } from "$fresh/runtime.ts";
import { DEFAULT_STYLE } from "style";
import { fetch_db } from "db";
import { URL } from "utils";
import ConversationLink from "components/ConversationLink.tsx";
import WithStyleSheet from "components/WithStyleSheet.tsx";
import Meta from "components/Meta.tsx";
export default function Home({ db }: { db: Database }) {
const [data, setData] = useState(db);
const links = Object.keys(data.conversations)
.reverse()
.map(c =>