@meimfhd/notebook
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Notebook

npm install @meimfhd/notebook

import { notionToNextra } from "@meimfhd/notebook";
export default async function Home() {
  return (
    <form
      className="flex flex-col gap-2 h-screen w-full justify-center items-center"
      action={async (formdata: FormData) => {
        "use server";
        const { msg } = await notionToNextra({
          pageId: formdata.get("pageId") as string,
          rootRouteName: (formdata.get("routeRouteName") as string) ?? "docs",
          rootRouteTitle: (formdata.get("title") as string) ?? "docs",
          token: process.env.token!,
        });
        console.log(msg);
      }}
    >
      <input
        type="text"
        name="pageId"
        id="pageId"
        placeholder="Enter your notion page Id"
        className="text-blue-700 px-2 py-1"
      />
      <input
        type="text"
        name="rootRouteName"
        id="rootRouteName"
        placeholder="Enter route name e.g.(docs) "
        className="text-blue-700 px-2 py-1"
      />
      <input
        type="text"
        name="title"
        id="title"
        placeholder="Enter title for your index page"
        className="text-blue-700 px-2 py-1"
      />
      <button
        className=" bg-blue-700 px-2 py-1 hover:translate-y-[-1px] active:translate-y-[1px] focus:ring-2 border "
        type="submit"
      >
        Start Generating Docs
      </button>
    </form>
  );
}


Package Sidebar

Install

npm i @meimfhd/notebook

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

15.7 kB

Total Files

6

Last publish

Collaborators

  • meimfhd