diff --git a/src/components/button/ButtonBounceEffect/ButtonBounceEffect.tsx b/src/components/button/ButtonBounceEffect/ButtonBounceEffect.tsx index 7713282..1df6162 100644 --- a/src/components/button/ButtonBounceEffect/ButtonBounceEffect.tsx +++ b/src/components/button/ButtonBounceEffect/ButtonBounceEffect.tsx @@ -1,57 +1,74 @@ -import React, { forwardRef } from "react"; -import { cn } from "@/lib/utils"; -import { useButtonClick } from "@/components/button/useButtonClick"; +"use client"; -interface ButtonProps extends React.ButtonHTMLAttributes { +import { useRef, memo } from "react"; +import { useCharAnimation } from "../useCharAnimation"; +import { useButtonClick } from "../useButtonClick"; +import { cls } from "@/lib/utils"; +import "./BounceButton.css"; + +interface ButtonBounceEffectProps { text: string; + onClick?: () => void; href?: string; + className?: string; bgClassName?: string; textClassName?: string; - iconClassName?: string; - newTab?: boolean; + disabled?: boolean; + ariaLabel?: string; + type?: "button" | "submit" | "reset"; + scrollToSection?: boolean; } -export const ButtonBounceEffect = forwardRef( - ( - { - text, - onClick, - href, - className, - bgClassName, - textClassName, - iconClassName, - disabled = false, - ariaLabel, - type = "button", newTab, - ...props - }, - ref - ) => { - const clickHandler = useButtonClick(href, onClick, newTab); +const ButtonBounceEffect = ({ + text, + onClick, + href, + className = "", + bgClassName = "", + textClassName = "", + disabled = false, + ariaLabel, + type = "button", + scrollToSection, +}: ButtonBounceEffectProps) => { + const buttonRef = useRef(null); + const handleClick = useButtonClick(href, onClick, scrollToSection); - return ( - - ); - } -); + {text} + + + ); +}; ButtonBounceEffect.displayName = "ButtonBounceEffect"; + +export default memo(ButtonBounceEffect);