"use client" import { motion, useReducedMotion, type Transition } from "motion/react" import { cn } from "@/lib/utils" interface BorderBeamProps { /** * Approximate length of the visible beam. Mapped to conic spread. */ size?: number /** * The duration of one full loop (seconds). */ duration?: number /** * The delay of the border beam. */ delay?: number /** * The color of the border beam from. */ colorFrom?: string /** * The color of the border beam to. */ colorTo?: string /** * The motion transition of the border beam. */ transition?: Transition /** * The class name of the border beam. */ className?: string /** * The style of the border beam. */ style?: React.CSSProperties /** * Whether to reverse the animation direction. */ reverse?: boolean /** * The initial offset position (0-100). */ initialOffset?: number /** * The border width of the beam. */ borderWidth?: number } /** * Soft beam riding the parent border via a masked rotating conic-gradient. * Avoids offset-path corner breaks while staying flush with rounded frames. */ export const BorderBeam = ({ className, size = 50, delay = 0, duration = 6, colorFrom = "#29A19C", colorTo = "#044343", transition, style, reverse = false, initialOffset = 0, borderWidth = 1, }: BorderBeamProps) => { const reduceMotion = useReducedMotion() // Map legacy px "size" → angular span (deg). Clamped so the beam stays a short arc. const spread = Math.min(48, Math.max(12, size * 0.18)) const startAngle = initialOffset * 3.6 return (