Newer
Older
import Image from "next/image";
import { Avatar, Button, Card, Text, useMantineTheme } from "@mantine/core";
import imageLoader from "../content/imageLoader";
import thealt_logo from "../public/images/thealt_signet.svg";
import thealt_logo_inv from "../public/images/thealt_signet_inv.svg";
export default function BoardMemberCard({ entry }) {
const theme = useMantineTheme();
const { locale, push } = useRouter();
const sendMail = (address) => {
push("mailto:" + address);
};
const images = imageLoader();
const image =
images[entry.name] ||
(theme.colorScheme === "dark" ? thealt_logo_inv : thealt_logo);
radius="md"
withBorder
p="lg"
style={{
display: "flex",
flexDirection: "column",
justifyContent: "space-between",
flexGrow: 1,
}}
shadow="sm"
>
<div>
<div
style={{
width: "120px",
height: "120px",
borderRadius: "1rem",
margin: "auto",
overflow: "hidden",
}}
>
{image && (
<Image
src={image}
width={0}
height={0}
sizes="100vw"
style={{ width: "30rem", maxWidth: "100%", height: "auto" }}
alt={entry.name}
/>
)}
<Text ta="center" fz="lg" weight={500} mt="md">
{entry.name}
</Text>
<Text ta="center" c="dimmed" fz="sm">
{entry.mail ? entry.mail.replace("@", " [ät] ") + " • " : ""}
{entry.role[locale || "en"]}
<Button
leftIcon={<Icon icon={ICONS.EMAIL} color={getAccentColor(theme)} />}
variant="default"
fullWidth
mt="md"
onClick={() => sendMail(entry.mail)}
>
Send message
</Button>