import Giscus, { BooleanString, Mapping, Repo } from "@giscus/react"; import { useTheme } from "next-themes"; export interface GiscusConfig { provider: "giscus"; pages?: Array; config: { theme?: string; mapping: Mapping; repo: Repo; repositoryId: string; category: string; categoryId: string; reactions: BooleanString; metadata: BooleanString; inputPosition?: string; lang?: string; }; } export type GiscusProps = GiscusConfig["config"]; export const GiscusReactComponent: React.FC = ({ repo, repositoryId, category, categoryId, reactions = "0", metadata = "0", mapping = "pathname", theme = "light", }) => { const { theme: nextTheme, resolvedTheme } = useTheme(); const commentsTheme = nextTheme === "dark" || resolvedTheme === "dark" ? "transparent_dark" : theme; return ( ); };