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