diff --git a/src/components/link-components/ButtonAction.tsx b/src/components/link-components/ButtonAction.tsx index 29ed37d..1b498b0 100644 --- a/src/components/link-components/ButtonAction.tsx +++ b/src/components/link-components/ButtonAction.tsx @@ -1,5 +1,7 @@ +"use client"; + import { Button } from "@nextui-org/react"; -import { ReactNode } from "react"; +import { ReactNode, useEffect, useState } from "react"; interface ButtonActionProps { icon?: ReactNode; @@ -12,10 +14,28 @@ export default function ButtonAction({ onPress, name, }: ButtonActionProps) { + const [reduceMotion, setReduceMotion] = useState(false); + + useEffect(() => { + const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)"); + setReduceMotion(mediaQuery.matches); + + const handleChange = (event: MediaQueryListEvent) => { + setReduceMotion(event.matches); + }; + mediaQuery.addEventListener("change", handleChange); + + return () => { + mediaQuery.removeEventListener("change", handleChange); + }; + }, []); + return (