aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/app/dashboard/highlights/page.tsx
blob: 5945de002decda7ebf8e2e4ce8ab0d57968b731b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import type { Metadata } from "next";
import AllHighlights from "@/components/dashboard/highlights/AllHighlights";
import { Separator } from "@/components/ui/separator";
import { useTranslation } from "@/lib/i18n/server";
import { api } from "@/server/api/client";
import { Highlighter } from "lucide-react";

export async function generateMetadata(): Promise<Metadata> {
  // oxlint-disable-next-line rules-of-hooks
  const { t } = await useTranslation();
  return {
    title: `${t("common.highlights")} | Karakeep`,
  };
}

export default async function HighlightsPage() {
  // oxlint-disable-next-line rules-of-hooks
  const { t } = await useTranslation();
  const highlights = await api.highlights.getAll({});
  return (
    <div className="flex flex-col gap-8 rounded-md border bg-background p-4">
      <span className="flex items-center gap-1 text-2xl">
        <Highlighter className="size-6" />
        {t("common.highlights")}
      </span>
      <Separator />
      <AllHighlights highlights={highlights} />
    </div>
  );
}