mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-15 16:51:37 +00:00
refactor copy code button
change pre component to server component
This commit is contained in:
@ -15,6 +15,12 @@ interface Props {
|
||||
showFileName?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render GitHub gists code.
|
||||
*
|
||||
* @params file
|
||||
* @params showaFileName determine show full content or not
|
||||
*/
|
||||
const GistsCode = ({ file, showFileName = false }: Props) => {
|
||||
const fileContent = showFileName
|
||||
? file.content
|
||||
@ -33,7 +39,7 @@ const GistsCode = ({ file, showFileName = false }: Props) => {
|
||||
return (
|
||||
<>
|
||||
{showFileName ? (
|
||||
<div className={styles.wrapper}>
|
||||
<div className={clsx(styles.wrapper, 'relative group')}>
|
||||
<div className="h-[30px] bg-[#f6f8fa] dark:bg-[hsl(220,13%,18%)] flex">
|
||||
<div className="flex items-center h-full mx-3">
|
||||
<div
|
||||
|
Reference in New Issue
Block a user