{"version":3,"file":"static/js/1470.fc352561.chunk.js","mappings":"2JAwCA,QAtCA,WACE,MAAOA,EAAYC,IAAiBC,EAAAA,EAAAA,WAAS,GAa7C,SAASC,IACHC,OAAOC,QAAU,GACnBJ,GAAc,GAEdA,GAAc,EAElB,CAOA,OAxBAK,EAAAA,EAAAA,YAAU,KAERF,OAAOG,iBAAiB,SAAUJ,GAG3B,KACLC,OAAOI,oBAAoB,SAAUL,EAAa,IAEnD,KAiBDM,EAAAA,EAAAA,KAAA,OAAAC,SACGV,IACCS,EAAAA,EAAAA,KAAA,UAAQE,GAAG,kBAAkBC,QAPnC,WACER,OAAOS,SAAS,CAAEC,IAAK,EAAGC,SAAU,UACtC,EAKuDC,MAAO,CAAEC,QAAS,SAAUP,UAC7ED,EAAAA,EAAAA,KAAA,KAAGS,UAAU,uBAKrB,C","sources":["components/ScrolltoTop/ScrolltoTop.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\n\nfunction ScrollToTopButton() {\n const [showButton, setShowButton] = useState(false);\n\n useEffect(() => {\n // Add a scroll event listener\n window.addEventListener('scroll', handleScroll);\n \n // Clean up the event listener on unmount\n return () => {\n window.removeEventListener('scroll', handleScroll);\n };\n }, []);\n\n // Function to handle scrolling\n function handleScroll() {\n if (window.scrollY > 20) {\n setShowButton(true);\n } else {\n setShowButton(false);\n }\n }\n\n // Function to scroll to the top\n function backToTop() {\n window.scrollTo({ top: 0, behavior: 'smooth' });\n }\n\n return (\n
\n {showButton && (\n \n )}\n
\n );\n}\n\nexport default ScrollToTopButton;"],"names":["showButton","setShowButton","useState","handleScroll","window","scrollY","useEffect","addEventListener","removeEventListener","_jsx","children","id","onClick","scrollTo","top","behavior","style","display","className"],"sourceRoot":""}