diff --git a/src/components/pages/event/pudgy-asia-tour/Pudgy.tsx b/src/components/pages/event/pudgy-asia-tour/Pudgy.tsx index 4f38cb07..da81842d 100644 --- a/src/components/pages/event/pudgy-asia-tour/Pudgy.tsx +++ b/src/components/pages/event/pudgy-asia-tour/Pudgy.tsx @@ -8,6 +8,7 @@ import Logo from './assets/Punkga logo.svg' import Link from 'next/link' import { useTranslation } from 'react-i18next' import { useRouter } from 'next/router' +import useSWR from 'swr' export default function PudgyList() { const { t } = useTranslation() const { locale } = useRouter() @@ -15,6 +16,11 @@ export default function PudgyList() { const [selected, setSelected] = useState(pudgyData[0]) const [selectedPudgy, setSelectedPudgy] = useState(pudgyData[0]) const [scope, animate] = useAnimate() + const { data: pudgyDataCMS, isLoading } = useSWR( + 'https://script.google.com/macros/s/AKfycbzLDJKGXgn6fAqNXolc4_ZSLAQauYvOhtu1vUrgiw1UVTzfgE3q1kRozAs2IU77kQljWg/exec', + (url) => fetch(url).then((res) => res.json()) + ) + const mangas = pudgyDataCMS?.mangaData?.filter((d) => d.pudgy.toLowerCase() == selectedPudgy.name.toLowerCase()) return ( <>