Files
lixiyu-net/components/readerpage/PostComments.tsx

29 lines
824 B
TypeScript
Raw Normal View History

2023-12-25 17:21:39 +08:00
import { Config } from "@/data/config";
import Giscus from "@giscus/react";
import { useTheme } from "next-themes";
export const PostComments = (props: { postId: string }) => {
const { theme } = useTheme();
return (
Config.Giscus && (
<div className="mt-10 mb-5">
2023-12-25 17:21:39 +08:00
<Giscus
category={Config.Giscus.category}
categoryId={Config.Giscus.categoryId}
emitMetadata="0"
2024-04-03 22:08:27 +08:00
id={props.postId}
2023-12-25 17:21:39 +08:00
inputPosition="top"
lang="en"
2024-04-03 22:08:27 +08:00
loading="eager"
mapping="pathname"
reactionsEnabled="1"
repo={Config.Giscus.repo as `${string}/${string}`}
repoId={Config.Giscus.repoId}
term={props.postId}
theme={theme === "light" ? "light_tritanopia" : "dark_tritanopia"}
2023-12-25 17:21:39 +08:00
/>
</div>
)
);
};