diff --git a/src/app/author/page.tsx b/src/app/author/page.tsx new file mode 100644 index 0000000..37c0730 --- /dev/null +++ b/src/app/author/page.tsx @@ -0,0 +1,83 @@ +import { authors, affiliations } from '@/app/db/data' +import { notFound } from 'next/navigation' +import { Zilla_Slab } from 'next/font/google' +import { Fragment } from 'react' +import Image from 'next/image' +import Link from 'next/link' +import cardEffects from '@/app/styles/cardEffects.module.css' + +const zillaSlab = Zilla_Slab({ subsets: ['latin'], weight: ['500'] }) + +export function generateStaticParams() { + const authorsList = Object.keys(authors) + return authorsList.map((shortName) => ({ shortName })) +} + +const AuthorCard = ({ + params, +}: Readonly<{ params: { shortName: string } }>) => { + const { shortName } = params + const { name, image, affiliation } = authors[shortName] + if (!name) { + notFound() + } + + const mainAffiliationShort = affiliation[0].split('@')[1] + const mainPosition = affiliation[0].split('@')[0] + const mainAffiliation = affiliations[mainAffiliationShort] + + return ( + +
+
+ profile +
+
+ + {name.first} {name.last} + +
+ {mainPosition} at{' '} + + {mainAffiliation.name} + +
+
+ + ) +} + +const Page = () => { + return ( +
+

+ Affiliations +

+
+ {Object.keys(authors).map((authorShortName) => { + return ( + + + + ) + })} +
+
+ ) +} + +export default Page