Skip to content

Instantly share code, notes, and snippets.

@adhithiravi
Created June 26, 2024 15:09
Show Gist options
  • Save adhithiravi/d5aaa39eb122f01920116932cc28f47f to your computer and use it in GitHub Desktop.
Save adhithiravi/d5aaa39eb122f01920116932cc28f47f to your computer and use it in GitHub Desktop.
Update Speakers page to fetch speraker info and display it
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