42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { Metadata } from "next";
|
|
import { redirect } from "next/navigation";
|
|
import { Home } from "./_components/Home";
|
|
// import { getServerSession } from "app/_lib/authentication";
|
|
// import { Home } from "@link-stack/leafcutter-ui";
|
|
// import { getUserVisualizations } from "@link-stack/opensearch-common";
|
|
// import { LeafcutterWrapper } from "@link-stack/leafcutter-ui";
|
|
|
|
export const metadata: Metadata = {
|
|
title: "CDR Link - Home",
|
|
};
|
|
|
|
export default async function Page() {
|
|
const leafcutterEnabled = process.env.LEAFCUTTER_ENABLED === "true";
|
|
const dashboardURL = process.env.LEAFCUTTER_DEFAULT_DASHBOARD_URL;
|
|
|
|
if (!leafcutterEnabled) {
|
|
redirect("/overview/recent");
|
|
}
|
|
/*
|
|
const session = await getServerSession();
|
|
const {
|
|
user: { email },
|
|
}: any = session;
|
|
*/
|
|
let visualizations = [];
|
|
/*
|
|
try {
|
|
visualizations = await getUserVisualizations(email ?? "none", 20);
|
|
} catch (e) {
|
|
console.error(e.meta);
|
|
}
|
|
|
|
return (
|
|
<LeafcutterWrapper>
|
|
<Home visualizations={visualizations} showWelcome={false} />
|
|
</LeafcutterWrapper>
|
|
);
|
|
*/
|
|
|
|
return <Home url={dashboardURL} />;
|
|
}
|