diff --git a/src/components/code-block.tsx b/src/components/code-block.tsx index 463240b7..44a5bacb 100644 --- a/src/components/code-block.tsx +++ b/src/components/code-block.tsx @@ -1,13 +1,4 @@ -import { - PropsWithChildren, - createContext, - forwardRef, - useContext, - useEffect, - useId, - useMemo, - useState, -} from "react"; +import { PropsWithChildren, createContext, forwardRef, useContext, useEffect, useId, useMemo, useState } from "react"; import type { WithStyleProps } from "../types/with-style-props"; import { cx } from "../lib/cx"; @@ -114,6 +105,7 @@ const CodeBlockLine = forwardRef( return ( void; }; -const CodeBlockCopyButton = forwardRef(({ className, onCopy, onCopyError, style }, ref) => { - const ctx = useContext(CodeBlockCopyContext); - const [copied, setCopied] = useState(false); +const CodeBlockCopyButton = forwardRef( + ({ className, onCopy, onCopyError, style }, ref) => { + const ctx = useContext(CodeBlockCopyContext); + const [copied, setCopied] = useState(false); - return ( - - ); -}); + return ( + + ); + }, +); export { CodeBlock, CodeBlockContent, CodeBlockCopyButton, CodeBlockLine };