perf: reduce bundle size of some pages

This commit is contained in:
rusconn
2023-06-15 18:44:39 +09:00
parent 6612a3be2d
commit 4d198c5b96
10 changed files with 27 additions and 24 deletions

View File

@@ -1,7 +1,6 @@
"use client";
import { useCallback, useMemo, useState } from "react";
import * as O from "fp-ts/lib/Option";
import { toolGroups } from "@/config/tools";
import { decode } from "@/lib/jwt";
@@ -21,8 +20,8 @@ export default function Page() {
);
const { header: h, payload: p } = decode(jwt);
const header = O.isNone(h) ? "" : JSON.stringify(h.value, null, 2);
const payload = O.isNone(p) ? "" : JSON.stringify(p.value, null, 2);
const header = h.isErr() ? "" : JSON.stringify(h.value, null, 2);
const payload = p.isErr() ? "" : JSON.stringify(p.value, null, 2);
const clearJwt = useCallback(() => setJwt(""), []);