Created
March 9, 2023 22:11
-
-
Save femakin/44d3566134725af666118c644f50882c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Amplify } from "aws-amplify"; | |
import awsconfig from "../../Backend/Backend/aws-exports"; | |
import styles from "../styles/Home.module.css"; | |
import { useEffect, useState } from "react"; | |
import Navbar from "@/components/Navbar/Navbar"; | |
import Jobdetails from "@/components/JobDetails/Jobdetails"; | |
import getData from "./api/getdata"; | |
Amplify.configure({ ...awsconfig, ssr: true }); | |
function Home() { | |
const [data, setData] = useState([]); | |
useEffect(() => { | |
const fetchData = async () => { | |
const result = await getData(); | |
setData(result); | |
}; | |
fetchData(); | |
}, [data]); | |
return ( | |
<div className={styles.home_container}> | |
<Navbar /> | |
{data && <Jobdetails data={data} />} | |
</div> | |
); | |
} | |
export default Home; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment