"use client"; import React, { useState, useEffect, useRef, forwardRef, useImperativeHandle, } from "react"; import { Mask, Image } from "antd-mobile"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faAngleLeft, faAngleRight } from "@fortawesome/free-solid-svg-icons"; import { createRoot } from "react-dom/client"; import { useRouter } from "next/navigation"; import baseRequest from "@/utils/baseRequest"; function ImagesMask({}, ref) { const [visible, setVisible] = useState(false); const [images, setImages] = useState([]); const [data, setData] = useState(null); const scrollRef = useRef(null); const defaultIndex = useRef(null); const router = useRouter(); useEffect(() => { if (visible) { const root = createRoot(document?.getElementById("maskDomBox")); root.render(