Skip to content

Commit

Permalink
fix(): Pass className to copy button.
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanCQ committed Sep 17, 2024
1 parent ae7103d commit 6fdf4d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/custom/docs/components/header/CodeCopy.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client'
import React from "react"

import {Button} from 'src'
import {Button, cn} from 'src'
import { Check, Copy } from "lucide-react"
export const CodeCopy = (props: {textToCopy: string}) => {
export const CodeCopy = (props: {textToCopy: string, className?: string}) => {

const [copied, setHasCopied] = React.useState(false)

Expand All @@ -13,7 +13,7 @@ export const CodeCopy = (props: {textToCopy: string}) => {
<Button
variant="ghost"
size="icon"
className={`${copied ? ' hover:bg-transparent' : 'hover:bg-background/50 hover:text-foreground/75'} ml-1`}
className={cn(`${copied ? ' hover:bg-transparent' : 'hover:bg-background/50 hover:text-foreground/75'} ml-1`, props.className)}
onClick={() => {
window.navigator.clipboard.writeText(props.textToCopy)
setHasCopied(true)
Expand Down

0 comments on commit 6fdf4d3

Please sign in to comment.