diff --git a/pages/index.tsx b/pages/index.tsx index 176ff24..6aef2da 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,9 +1,23 @@ import type { NextPage } from 'next' import Head from 'next/head' import Image from 'next/image' +import { ReactElement, useEffect, useState } from 'react' +import { Status } from '../@types' import styles from '../styles/Home.module.css' +import { getData } from '../utils/getData' + +export default function HomePage(): ReactElement { + const [statuses, setStatuses] = useState() + + useEffect(() => { + async function getStatuses() { + const data = await getData() + data && setStatuses(data) + console.log('statuses', statuses) + } + getStatuses() + }, []) -const Home: NextPage = () => { return (
@@ -66,5 +80,3 @@ const Home: NextPage = () => {
) } - -export default Home