import { useRef } from "react"; import Autoplay from "embla-carousel-autoplay"; import { useQuery } from "@tanstack/react-query"; import { ENDPOINT } from "../../config"; import { getSiteInfo, getBannerList, getImageUrlByAtflCd } from "../../api"; import { getCookie } from "../../lib"; import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, } from "../carousel"; type BannerImageProps = { atflCd: string; bnrSn: number; lnkgUrlAddr: string; }; const BannerImage = ({ atflCd, lnkgUrlAddr }: BannerImageProps) => { const { data: imageUrl, isLoading } = useQuery({ queryKey: [ENDPOINT.ATTACH_SERVICE.IMAGES, atflCd], queryFn: () => getImageUrlByAtflCd(atflCd), enabled: !!atflCd, }); const handleClick = () => { if (lnkgUrlAddr) { window.open(lnkgUrlAddr, "_blank"); } }; if (isLoading) { return (