"use client"; import Link from "next/link"; import { useEffect, useRef, useState } from "react"; import { Card, CardContent } from "@/components/shadcn/card/card"; import { cn } from "@/lib/utils"; import { LighthouseIcon } from "../icons"; const AnimatedGradientCard = ({ message, href, }: { message: string; href: string; }) => { const interactiveRef = useRef(null); const curXRef = useRef(0); const curYRef = useRef(0); const tgXRef = useRef(0); const tgYRef = useRef(0); const [isSafari, setIsSafari] = useState(false); useEffect(() => { setIsSafari(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)); }, []); useEffect(() => { let animationFrameId: number; const move = () => { if (!interactiveRef.current) return; curXRef.current += (tgXRef.current - curXRef.current) / 20; curYRef.current += (tgYRef.current - curYRef.current) / 20; interactiveRef.current.style.transform = `translate(${Math.round(curXRef.current)}px, ${Math.round(curYRef.current)}px)`; animationFrameId = requestAnimationFrame(move); }; animationFrameId = requestAnimationFrame(move); return () => { cancelAnimationFrame(animationFrameId); }; }, []); const handleMouseMove = (event: React.MouseEvent) => { if (interactiveRef.current) { const rect = interactiveRef.current.getBoundingClientRect(); tgXRef.current = event.clientX - rect.left; tgYRef.current = event.clientY - rect.top; } }; return (

{message}

); }; export const LighthouseBannerClient = ({ isConfigured, }: { isConfigured: boolean; }) => { const message = isConfigured ? "Use Lighthouse to review your findings and gain insights" : "Enable Lighthouse to secure your cloud with AI insights"; const href = isConfigured ? "/lighthouse" : "/lighthouse/config"; return ; };