// @ts-nocheck 'use client'; import { AnimatePresence, motion } from 'framer-motion'; import React, { useEffect, useId, useRef, useState } from 'react'; import { cn } from '../../lib/utils'; import { SparklesCore } from './sparkles'; export const Cover = ({ children, className, }: { children?: React.ReactNode; className?: string; }) => { const [hovered, setHovered] = useState(false); const ref = useRef(null); const [containerWidth, setContainerWidth] = useState(0); const [beamPositions, setBeamPositions] = useState([]); useEffect(() => { if (ref.current) { setContainerWidth(ref.current?.clientWidth ?? 0); const height = ref.current?.clientHeight ?? 0; const numberOfBeams = Math.floor(height / 10); // Adjust the divisor to control the spacing const positions = Array.from( { length: numberOfBeams }, (_, i) => (i + 1) * (height / (numberOfBeams + 1)), ); setBeamPositions(positions); } }, [ref.current]); return (
setHovered(true)} onMouseLeave={() => setHovered(false)} ref={ref} className='group/cover relative inline-block rounded-sm bg-neutral-100 px-2 py-2 transition duration-200 hover:bg-neutral-900 dark:bg-neutral-900' > {hovered && ( )} {beamPositions.map((position, index) => ( ))} {children}
); }; export const Beam = ({ className, delay, duration, hovered, width = 600, ...svgProps }: { className?: string; delay?: number; duration?: number; hovered?: boolean; width?: number; } & React.ComponentProps) => { const id = useId(); return ( ); }; export const CircleIcon = ({ className, delay }: { className?: string; delay?: number }) => { return (
); };