// 'use client' // import { useEffect, useState } from 'react' // export default function AboutPage() { // const [data, setData] = useState(null) // const [loading, setLoading] = useState(true) // useEffect(() => { // fetch((process.env.NEXT_PUBLIC_API_URL as string) + "/docs.json") // .then((res) => res.json()) // .then((result) => { // setData(result) // setLoading(false) // }) // .catch((err) => { // console.error(err) // setLoading(false) // }) // }, []) // return ( //
// {loading &&

Loading...

} // {!loading && data && ( //
{JSON.stringify(data, null, 2)}
// )} //
// ) // } 'use client' import { useEffect, useState } from 'react' import Spinner from '@/components/spinner' export default function AboutPage() { const [data, setData] = useState(null) const [loading, setLoading] = useState(true) useEffect(() => { fetch((process.env.NEXT_PUBLIC_API_URL as string) + '/docs.json') .then((res) => res.json()) .then((result) => { setData(result) setLoading(false) }) .catch(() => { setLoading(false) }) }, []) if (loading) { return (
) } return (
) }