diff --git a/public/roasts.json b/public/roasts.json new file mode 100644 index 0000000..812a388 --- /dev/null +++ b/public/roasts.json @@ -0,0 +1,4 @@ +[ + { "image": "placeholder-1.jpg", "caption": "Thêm ảnh vào thư mục public/images/ nhé! 😄" }, + { "image": "placeholder-2.jpg", "caption": "Chỉnh caption trong public/roasts.json" } +] diff --git a/src/components/RoastGallery.jsx b/src/components/RoastGallery.jsx new file mode 100644 index 0000000..9905f7f --- /dev/null +++ b/src/components/RoastGallery.jsx @@ -0,0 +1,30 @@ +import { useState, useEffect } from 'react' +import RoastCard from './RoastCard' + +export default function RoastGallery() { + const [roasts, setRoasts] = useState([]) + + useEffect(() => { + fetch('/roasts.json') + .then((res) => res.json()) + .then((data) => setRoasts(data)) + .catch((err) => console.error('Failed to load roasts:', err)) + }, []) + + return ( +
+

+ 📸 Bộ Sưu Tập "Huyền Thoại" +

+
+ {roasts.map((roast, index) => ( + + ))} +
+
+ ) +}