"use client"; import React, { useState, useEffect } from "react"; import Link from "next/link"; import Image from "next/image"; import { areaOfInjuryData } from "@/utils/AreaOfInjery.utils"; export default function AreaOfInjury() { const [isMobile, setIsMobile] = useState(false); // ✅ Detect mobile screen (same logic as Header2) useEffect(() => { const checkScreenSize = () => setIsMobile(window.innerWidth <= 768); checkScreenSize(); window.addEventListener("resize", checkScreenSize); return () => window.removeEventListener("resize", checkScreenSize); }, []); return (
{/* ===== Background Patterns ===== */}
Physiotherapy Background
Physiotherapy Background
{/* ===== Section Header ===== */}
Start Your Treatment Today!
Visit our healthcare team in Etobicoke.

Area Of Injury

{/* ===== Injuries Grid ===== */}
{areaOfInjuryData.slice(0, 8).map((area, index) => { // ✅ Same concept as Header logo switching const imageSrc = isMobile ? area.mobileImage || area.image // if mobile image exists, use it : area.image; return (
{/* ✅ Using Next/Image for automatic optimization */} {area.title}

{area.title}

); })} {/* ===== View All Button ===== */}
View All
); }