diff --git a/packages/web/src/common/components/Banner/Banner.tsx b/packages/web/src/common/components/Banner/Banner.tsx index 855c7c3..7686048 100644 --- a/packages/web/src/common/components/Banner/Banner.tsx +++ b/packages/web/src/common/components/Banner/Banner.tsx @@ -4,6 +4,7 @@ import Image from "next/image"; type BannerProps = { images?: string[]; + alt?: string[]; onClick?: (idx: number) => void; }; @@ -38,8 +39,20 @@ const Arrow = styled.button` z-index: 1; `; +const IndexWrapper = styled.div` + display: flex; + margin-top: 8px; + justify-content: center; +`; + +const StyledImage = styled(Image)` + width: 100%; + height: auto; +`; + const Banner: React.FC = ({ images = ["temp/1.jpg", "temp/2.jpg", "temp/3.jpg"], + alt = ["배너 이미지 1", "배너 이미지 2", "배너 이미지 3"], onClick = _idx => {}, }) => { const [currentIndex, setCurrentIndex] = useState(0); @@ -63,21 +76,28 @@ const Banner: React.FC = ({ }, [currentIndex]); return ( - - {"<"} - -
- {`배너 onClick(currentIndex)} - /> -
- - {">"} -
+
+ + {"<"} + +
+ onClick(currentIndex)} + /> +
+ + {">"} +
+ + + {currentIndex + 1} / {images.length} + +
); }; export default Banner;