import React from 'react'; import useSWR from 'swr'; import { Showcase } from '@site/src/utils/apiTypes'; import { User } from '@site/src/utils/github'; import { fetcher } from '@site/src/utils/swr'; interface NetworkProps { id: string; } export const Network = ({ id }: NetworkProps): JSX.Element => { const { data, error } = useSWR( `http://localhost:4000/showcase/${id}`, fetcher ); const githubData = useSWR( `https://api.github.com/users/${data?.author?.githubUsername}`, fetcher ).data; return data && !error ? (

{data.title}

{data.summary}

{githubData && (
{githubData.name}
{githubData.name}
{githubData.bio}
)}
{data.body}

Bill of Materials

{data.materials?.map((material, index) => (
{material.name}
{material.details}
View
))}
) : (

Network not found

); };