import { useRef, useState } from "react"; function Icon() { return ; } interface Props { title: string; body: string; href?: string; imgSrc?: string; } export default function CardLink({ title, body, href, imgSrc }: Props) { const divRef = useRef(null); const [position, setPosition] = useState({ x: 0, y: 0 }); const [opacity, setOpacity] = useState(0); const handleMouseMove: React.MouseEventHandler = (e) => { if (!divRef.current) return; const rect = divRef.current.getBoundingClientRect(); setPosition({ x: e.clientX - rect.left, y: e.clientY - rect.top }); }; const handleMouseEnter = () => setOpacity(0.6); const handleMouseLeave = () => setOpacity(0); return ( window.open(href, "_blank", "noopener,noreferrer"), role: "link", tabIndex: 0, })} > {/* Spotlight overlay - light */} {/* Spotlight overlay - dark mode */} {/* Content */} {imgSrc && ( )} {title} {body} {href && } ); }
{body}