32 lines
826 B
TypeScript
32 lines
826 B
TypeScript
"use client";
|
|
|
|
import { motion } from "motion/react";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
interface ShimmerButtonProps {
|
|
children: React.ReactNode;
|
|
className?: string;
|
|
onClick?: () => void;
|
|
}
|
|
|
|
export function ShimmerButton({
|
|
children,
|
|
className,
|
|
onClick,
|
|
}: ShimmerButtonProps) {
|
|
return (
|
|
<motion.button
|
|
className={cn(
|
|
"relative overflow-hidden rounded-lg bg-gradient-to-r from-cyan-500 to-blue-600 px-6 py-3 font-semibold text-white shadow-lg",
|
|
className,
|
|
)}
|
|
whileHover={{ scale: 1.05 }}
|
|
whileTap={{ scale: 0.95 }}
|
|
onClick={onClick}
|
|
>
|
|
<div className="absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full animate-shimmer" />
|
|
<span className="relative z-10">{children}</span>
|
|
</motion.button>
|
|
);
|
|
}
|