@@ -7,6 +7,7 @@ import { motion } from "framer-motion";
77import NextImage from "next/image" ;
88import { usePlaceholder , PlaceholderImage } from "next-image-placeholder/react" ;
99import { getPlaceholderAction } from "@/app/actions" ;
10+ import { Tooltip } from "@/components/ui/tooltip" ;
1011
1112type DemoMode = "blur" | "color" | "client" ;
1213
@@ -41,9 +42,10 @@ export function DemoTabs({
4142 const containerRect = containerRef . current . getBoundingClientRect ( ) ;
4243 const activeRect = activeEl . getBoundingClientRect ( ) ;
4344
44- // Calculate relative positions
45- const left = activeRect . left - containerRect . left ;
46- const right = containerRect . width - ( left + activeRect . width ) ;
45+ // Calculate relative positions (accounting for container border + padding)
46+ const offset = 3 ; // 1px border + 2px padding (p-0.5)
47+ const left = ( activeRect . left - containerRect . left ) - offset ;
48+ const right = ( containerRect . width - ( activeRect . left - containerRect . left + activeRect . width ) ) - offset ;
4749
4850 setClipPath ( `inset(0 ${ right } px 0 ${ left } px round 9999px)` ) ;
4951 }
@@ -228,22 +230,25 @@ export function DemoTabs({
228230 </ div >
229231 </ div >
230232 < div className = "flex items-center gap-1" >
231- < motion . button
232- onClick = { handleRefresh }
233- animate = { { rotate : isRefreshing ? 360 : 0 } }
234- transition = { { duration : 0.5 , ease : "easeInOut" } }
235- className = "text-neutral-400 hover:text-white transition-colors p-2 hover:bg-neutral-800 rounded-md"
236- title = "Refresh Demo"
237- >
238- < RotateCw size = { 14 } />
239- </ motion . button >
240- < button
241- onClick = { copyCode }
242- className = "text-neutral-400 hover:text-white transition-colors p-2 hover:bg-neutral-800 rounded-md"
243- title = "Copy Code"
244- >
245- { copied ? < Check size = { 14 } /> : < Copy size = { 14 } /> }
246- </ button >
233+ < Tooltip content = "Refresh Demo" >
234+ < motion . button
235+ onClick = { handleRefresh }
236+ animate = { { rotate : isRefreshing ? 360 : 0 } }
237+ transition = { { duration : 0.5 , ease : "easeInOut" } }
238+ className = "text-neutral-400 hover:text-white transition-colors p-2 hover:bg-neutral-800 rounded-md"
239+ >
240+ < RotateCw size = { 14 } />
241+ </ motion . button >
242+ </ Tooltip >
243+
244+ < Tooltip content = "Copy Code" >
245+ < button
246+ onClick = { copyCode }
247+ className = "text-neutral-400 hover:text-white transition-colors p-2 hover:bg-neutral-800 rounded-md"
248+ >
249+ { copied ? < Check size = { 14 } /> : < Copy size = { 14 } /> }
250+ </ button >
251+ </ Tooltip >
247252 </ div >
248253 </ div >
249254 < div className = "flex-1 p-6 overflow-x-auto custom-scrollbar" >
0 commit comments