mirror of
https://github.com/r-freeman/portfolio.git
synced 2025-04-24 22:24:37 +00:00
Clean up code component
All checks were successful
Build And Publish / BuildAndPublish (push) Successful in 3m11s
All checks were successful
Build And Publish / BuildAndPublish (push) Successful in 3m11s
This commit is contained in:
parent
d09d66d4e5
commit
cd5aae039d
@ -3,7 +3,7 @@
|
|||||||
import React, {ReactNode, useRef, useState} from 'react'
|
import React, {ReactNode, useRef, useState} from 'react'
|
||||||
import {CheckIcon} from '@/components/icons/CheckIcon'
|
import {CheckIcon} from '@/components/icons/CheckIcon'
|
||||||
import {CopyIcon} from '@/components/icons/CopyIcon'
|
import {CopyIcon} from '@/components/icons/CopyIcon'
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx'
|
||||||
|
|
||||||
export function Code({children}: { children: ReactNode }) {
|
export function Code({children}: { children: ReactNode }) {
|
||||||
const [copied, setCopied] = useState<boolean>(false)
|
const [copied, setCopied] = useState<boolean>(false)
|
||||||
@ -28,7 +28,7 @@ export function Code({children}: { children: ReactNode }) {
|
|||||||
className={clsx('absolute text-zinc-400 hover:text-zinc-50 ease-in transform transition', !copied ? 'scale-100' : 'scale-0')}/>
|
className={clsx('absolute text-zinc-400 hover:text-zinc-50 ease-in transform transition', !copied ? 'scale-100' : 'scale-0')}/>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
<div className="mt-5 sm:mt-0 pb-5 overflow-auto ">
|
<div className="mt-5 sm:mt-0 pb-5 overflow-auto">
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
</pre>
|
</pre>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user