2023-08-16 23:29:22 +08:00
|
|
|
import { ReactNode } from 'react'
|
|
|
|
import type { Authors } from 'contentlayer/generated'
|
|
|
|
import SocialIcon from '@/components/social-icons'
|
|
|
|
import Image from '@/components/Image'
|
2022-07-17 21:40:41 +08:00
|
|
|
|
2022-10-07 13:55:39 +08:00
|
|
|
interface Props {
|
2023-08-16 23:29:22 +08:00
|
|
|
children: ReactNode
|
|
|
|
content: Omit<Authors, '_id' | '_raw' | 'body'>
|
2022-10-07 13:55:39 +08:00
|
|
|
}
|
|
|
|
|
2023-08-16 23:29:22 +08:00
|
|
|
export default function AuthorLayout({ children, content }: Props) {
|
|
|
|
const { name, avatar, occupation, company, email, twitter, linkedin, github } = content
|
2022-07-17 21:40:41 +08:00
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
2022-10-07 14:40:51 +08:00
|
|
|
<div className="divide-y divide-gray-200 dark:divide-gray-700">
|
2023-08-16 23:29:22 +08:00
|
|
|
<div className="space-y-2 pb-8 pt-6 md:space-y-5">
|
2022-07-17 21:40:41 +08:00
|
|
|
<h1 className="text-3xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 sm:text-4xl sm:leading-10 md:text-6xl md:leading-14">
|
|
|
|
About
|
|
|
|
</h1>
|
|
|
|
</div>
|
|
|
|
<div className="items-start space-y-2 xl:grid xl:grid-cols-3 xl:gap-x-8 xl:space-y-0">
|
2023-08-16 23:29:22 +08:00
|
|
|
<div className="flex flex-col items-center space-x-2 pt-8">
|
|
|
|
{avatar && (
|
|
|
|
<Image
|
|
|
|
src={avatar}
|
|
|
|
alt="avatar"
|
|
|
|
width={192}
|
|
|
|
height={192}
|
|
|
|
className="h-48 w-48 rounded-full"
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
<h3 className="pb-2 pt-4 text-2xl font-bold leading-8 tracking-tight">{name}</h3>
|
2022-07-17 21:40:41 +08:00
|
|
|
<div className="text-gray-500 dark:text-gray-400">{occupation}</div>
|
|
|
|
<div className="text-gray-500 dark:text-gray-400">{company}</div>
|
|
|
|
<div className="flex space-x-3 pt-6">
|
|
|
|
<SocialIcon kind="mail" href={`mailto:${email}`} />
|
|
|
|
<SocialIcon kind="github" href={github} />
|
|
|
|
<SocialIcon kind="linkedin" href={linkedin} />
|
|
|
|
<SocialIcon kind="twitter" href={twitter} />
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-08-16 23:29:22 +08:00
|
|
|
<div className="prose max-w-none pb-8 pt-8 dark:prose-invert xl:col-span-2">
|
2022-10-17 23:37:01 +08:00
|
|
|
{children}
|
|
|
|
</div>
|
2022-07-17 21:40:41 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</>
|
2023-08-16 23:29:22 +08:00
|
|
|
)
|
2022-07-17 21:40:41 +08:00
|
|
|
}
|