| 
									
										
										
										
											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 && ( | 
					
						
							| 
									
										
										
										
											2024-01-15 11:44:48 +08:00
										 |  |  |       <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" | 
					
						
							|  |  |  |           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> | 
					
						
							|  |  |  |     ) | 
					
						
							|  |  |  |   ); | 
					
						
							|  |  |  | }; |