import { redirect } from "next/navigation";
import AllLists from "@/components/dashboard/sidebar/AllLists";
import MobileSidebar from "@/components/shared/sidebar/MobileSidebar";
import Sidebar from "@/components/shared/sidebar/Sidebar";
import SidebarLayout from "@/components/shared/sidebar/SidebarLayout";
import { Separator } from "@/components/ui/separator";
import { api } from "@/server/api/client";
import { getServerAuthSession } from "@/server/auth";
import { TFunction } from "i18next";
import { Archive, Highlighter, Home, Search, Tag } from "lucide-react";
import serverConfig from "@hoarder/shared/config";
export default async function Dashboard({
children,
modal,
}: Readonly<{
children: React.ReactNode;
modal: React.ReactNode;
}>) {
const session = await getServerAuthSession();
if (!session) {
redirect("/");
}
const lists = await api.lists.list();
const items = (t: TFunction) =>
[
{
name: t("common.home"),
icon: ,
path: "/dashboard/bookmarks",
},
serverConfig.meilisearch
? [
{
name: t("common.search"),
icon: ,
path: "/dashboard/search",
},
]
: [],
{
name: t("common.tags"),
icon: ,
path: "/dashboard/tags",
},
{
name: t("common.highlights"),
icon: ,
path: "/dashboard/highlights",
},
{
name: t("common.archive"),
icon: ,
path: "/dashboard/archive",
},
].flat();
return (
>
}
/>
}
mobileSidebar={}
modal={modal}
>
{children}
);
}