From 0b97d30542bc3a3cbe798a01660c965e13f4083c Mon Sep 17 00:00:00 2001 From: Ryan Freeman Date: Wed, 16 Apr 2025 22:22:12 +0100 Subject: [PATCH] Add animation to code component --- components/ui/Code.tsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/components/ui/Code.tsx b/components/ui/Code.tsx index fea07f9..648ea5f 100644 --- a/components/ui/Code.tsx +++ b/components/ui/Code.tsx @@ -1,8 +1,9 @@ 'use client' import React, {ReactNode, useRef, useState} from 'react' -import {CopyIcon} from '@/components/icons/CopyIcon' import {CheckIcon} from '@/components/icons/CheckIcon' +import {CopyIcon} from '@/components/icons/CopyIcon' +import clsx from 'clsx'; export function Code({children}: { children: ReactNode }) { const [copied, setCopied] = useState(false) @@ -16,10 +17,16 @@ export function Code({children}: { children: ReactNode }) { } return ( -
-                
             
{children}