moved almost all deps to dev to speed up installs, updated nextjs docs

This commit is contained in:
dswbx
2024-12-07 08:48:48 +01:00
parent 110c7681b7
commit 44a427de67
5 changed files with 42 additions and 44 deletions

View File

@@ -1,20 +0,0 @@
import { withApi } from "bknd/adapter/nextjs";
import type { BkndAdminProps } from "bknd/ui";
import type { InferGetServerSidePropsType } from "next";
import dynamic from "next/dynamic";
export const getServerSideProps = withApi(async (context) => {
return {
props: {
user: context.api.getUser()
}
};
});
export function adminPage(adminProps?: BkndAdminProps) {
const Admin = dynamic(() => import("bknd/ui").then((mod) => mod.Admin), { ssr: false });
return (props: InferGetServerSidePropsType<typeof getServerSideProps>) => {
if (typeof document === "undefined") return null;
return <Admin withProvider={{ user: props.user }} {...adminProps} />;
};
}

View File

@@ -1,2 +1 @@
export * from "./nextjs.adapter";
export * from "./AdminPage";