"use client"; import React, { useRef, useState } from "react"; import { cn } from "@/lib/utils"; interface SpotlightCardProps { children: React.ReactNode; className?: string; size?: number; } export function SpotlightCard({ children, className, size = 400, }: SpotlightCardProps) { const ref = useRef(null); const [position, setPosition] = useState({ x: 0, y: 0 }); const [opacity, setOpacity] = useState(0); const handleMouseMove = (e: React.MouseEvent) => { if (!ref.current) return; const rect = ref.current.getBoundingClientRect(); setPosition({ x: e.clientX - rect.left, y: e.clientY - rect.top, }); setOpacity(1); }; const handleMouseLeave = () => { setOpacity(0); }; return (
{children}
); }