In the case of the 2018 heatwave, maximum temperatures were well captured in valley and mountain ridges such as the Pyrinees, while some differences in maximum temperature remained along the Portuguese western coast.
In the case of the 2018 heatwave, maximum temperatures were well captured in valley and mountain ridges such as the Pyrinees, while some differences in maximum temperature remained along the Portuguese western coast.
+
+
+
+
+ );
+};
\ No newline at end of file
diff --git a/src/components/energy/section-7/index.tsx b/src/components/energy/section-7/index.tsx
index d1bef0f..de82cb5 100644
--- a/src/components/energy/section-7/index.tsx
+++ b/src/components/energy/section-7/index.tsx
@@ -1,7 +1,6 @@
'use client';
import { useState } from "react";
import dynamic from 'next/dynamic';
-const Lines = dynamic(() => import('@/components/lines'), { ssr: false });
import { motion, AnimatePresence } from "framer-motion";
import KnowMoreButton from "@/components/know-more-button";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
diff --git a/src/lib/hooks.ts b/src/lib/hooks.ts
index a52b93c..eee7a2b 100644
--- a/src/lib/hooks.ts
+++ b/src/lib/hooks.ts
@@ -20,6 +20,29 @@ export const useScreenWidthWithResize = () => {
return width;
};
+export const useContainerWidthWithResize = (containerRef: React.RefObject) => {
+ const [containerWidth, setContainerWidth] = useState(0);
+ // Set initial width on mount. Window is not available on server side.
+ useEffect(() => {
+ if (containerRef.current) {
+ setContainerWidth(containerRef.current.offsetWidth);
+ }
+ }, [containerRef]);
+
+ const handleResize = useCallback(() => {
+ if (containerRef.current) {
+ setContainerWidth(containerRef.current.offsetWidth);
+ }
+ }, [containerRef]);
+
+ useEffect(() => {
+ window.addEventListener("resize", handleResize);
+ return () => window.removeEventListener("resize", handleResize);
+ }, [containerRef]);
+
+ return containerWidth;
+};
+
export const useIsMobile = () => {
const [isMobile, setIsMobile] = useState(false);
const isDesktopOrLaptop = useMediaQuery({