Created
June 26, 2024 15:09
-
-
Save adhithiravi/d5aaa39eb122f01920116932cc28f47f to your computer and use it in GitHub Desktop.
Update Speakers page to fetch speraker info and display it
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 styles from "../conference.module.css"; | |
import { fetchSpeakers } from "./services/speakers"; | |
export type Speaker = { | |
id: string; | |
name: string; | |
bio: string; | |
featured?: boolean; | |
}; | |
export type SpeakerSummary = Pick<Speaker, "id" | "name">; | |
export default async function Speakers() { | |
const speakersData = await fetchSpeakers(); | |
return ( | |
<> | |
<section className={styles.parentContainer}> | |
<section>Last Rendered: {new Date().toLocaleTimeString()}</section> | |
<h1>Welcome to Globomantics Speakers</h1> | |
{speakersData.speakers.map(({ id, name, bio }: Speaker) => ( | |
<section key={id} className={styles.infoContainer}> | |
<h3 className={styles.titleText}>Speaker: {name}</h3> | |
<h5 className={styles.descText}>Bio: {bio}</h5> | |
</section> | |
))} | |
</section> | |
</> | |
); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment