"use client";
import { motion } from "framer-motion";
import Link from "next/link";
import { cn } from "@/lib/utils";
import type { ReactNode } from "react";
interface GlowButtonProps {
children: ReactNode;
href?: string;
onClick?: () => void;
type?: "button" | "submit" | "reset";
variant?: "primary" | "secondary" | "ghost";
size?: "sm" | "md" | "lg";
className?: string;
icon?: ReactNode;
iconPosition?: "left" | "right";
disabled?: boolean;
}
export default function GlowButton({
children,
href,
onClick,
type = "button",
variant = "primary",
size = "md",
className,
icon,
iconPosition = "right",
disabled = false,
}: GlowButtonProps) {
const sizeStyles = {
sm: "h-9 px-4 text-sm",
md: "h-11 px-6 text-sm",
lg: "h-13 px-8 text-base",
}[size];
const variantStyles = {
primary: cn(
"bg-gradient-to-r from-purple-300 via-purple-500 to-purple-700",
"text-white shadow-glow-md",
"hover:shadow-glow-lg hover:brightness-110",
),
secondary: cn(
"glass-strong text-text-primary",
"hover:border-purple-400/40 hover:bg-elevated/60",
),
ghost: cn("text-text-secondary hover:text-text-primary hover:bg-white/5"),
}[variant];
const inner = (
{variant === "primary" && (
)}
{icon && iconPosition === "left" && (
{icon}
)}
{children}
{icon && iconPosition === "right" && (
{icon}
)}
);
if (href) {
return {inner};
}
return (
);
}