import { Avatar } from "@mui/material";
import { Member } from "../api/genealogy/MemberApi";

export function MemberPhoto(p: {
  member?: Member;
  width?: number;
}): React.ReactElement {
  return (
    <Avatar
      sx={
        p.width
          ? { width: `${p.width}px`, height: "auto", display: "inline-block" }
          : undefined
      }
      variant="rounded"
      src={p.member?.thumbnailURL ?? undefined}
    />
  );
}
