www-new/components/TeamMemberCard.tsx

32 lines
847 B
TypeScript

import React from "react";
import Image from "next/image";
import styles from "./TeamMemberCard.module.css";
interface TeamMemberCardProps {
name: string;
role: string;
image?: string; // path to image of person, relative to public directory
children: React.ReactNode;
}
export function TeamMemberCard(props: TeamMemberCardProps) {
return (
<div className={styles.card}>
<Image
className={styles.picture}
src={
props.image !== undefined
? props.image
: "/images/team-member-placeholder.svg"
}
width={126}
height={126}
alt={`Picture of ${props.name}`}
/>
<h1 className={styles.name}>{props.name}</h1>
<h2 className={styles.role}>{props.role}</h2>
<p className={styles.description}>{props.children}</p>
</div>
);
}