[update] migrate the project formatter from prettier and eslint to biome
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useActiveHeading } from "@/hooks/useActiveHeading";
|
||||
import { TTOCItem } from "@/types/toc.type";
|
||||
import type { TTOCItem } from "@/types/toc.type";
|
||||
import Link from "next/link";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
@@ -8,16 +8,16 @@ export const TOC = (props: { data: TTOCItem[] }) => {
|
||||
|
||||
return (
|
||||
<div className="mx-5">
|
||||
<div className="text-lg text-center p-2 font-bold border-t-2 border-b-2 border-gray-500">
|
||||
<div className="border-gray-500 border-t-2 border-b-2 p-2 text-center font-bold text-lg">
|
||||
{"TABLE OF CONTENTS"}
|
||||
</div>
|
||||
<div className="px-2 py-2 h-[60vh] overflow-y-auto flat-scrollbar-normal">
|
||||
<div className="flat-scrollbar-normal h-[60vh] overflow-y-auto px-2 py-2">
|
||||
<div>
|
||||
{props.data?.map((item) => (
|
||||
<Link href={`#${item.anchorId}`} key={`toc-${item.anchorId}`}>
|
||||
<div
|
||||
className={twMerge(
|
||||
`py-2 text-sm rounded-lg hover:text-sky-700 dark:hover:text-sky-400`,
|
||||
"rounded-lg py-2 text-sm hover:text-sky-700 dark:hover:text-sky-400",
|
||||
activeId === `#${item.anchorId}` ? "text-sky-700 dark:text-sky-400" : "",
|
||||
)}
|
||||
style={{ paddingLeft: `${item.level - 1}em` }}
|
||||
|
||||
Reference in New Issue
Block a user