import { useRef, useCallback, type ReactNode } from "react"; import type { GlassEffectProps } from "../types"; import GlassFilters from "./GlassFilters"; interface GlassContainerProps extends GlassEffectProps { children: ReactNode; className?: string; onClick?: (e: React.MouseEvent) => void; onMouseDown?: (e: React.MouseEvent) => void; role?: string; "aria-label"?: string; "aria-labelledby"?: string; style?: React.CSSProperties; } export default function GlassContainer({ children, className = "", bgColor = "rgba(0, 0, 0, 0.25)", highlight = "rgba(255, 255, 255, 0.15)", onClick, onMouseDown, role, style, ...ariaProps }: GlassContainerProps) { const specularRef = useRef(null); const handleMouseMove = useCallback((e: React.MouseEvent) => { if (!specularRef.current) return; const rect = e.currentTarget.getBoundingClientRect(); const x = e.clientX - rect.left; const y = e.clientY - rect.top; specularRef.current.style.background = `radial-gradient( circle at ${x}px ${y}px, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 30%, rgba(255,255,255,0) 60% )`; }, []); const handleMouseLeave = useCallback(() => { if (specularRef.current) { specularRef.current.style.background = "none"; } }, []); return (
{/* Glass layers */}
{/* Content */}
{children}
); }