Path: blob/master/src/packages/next/components/share/proxy/avatar.tsx
1451 views
import { CSSProperties } from "react";1import { Avatar, Tooltip } from "antd";2import A from "components/misc/A";3import { Icon } from "@cocalc/frontend/components/icon";4import { trunc } from "@cocalc/util/misc";56interface Props {7name: string;8repo?: string; // if given, impacts links9size?: number;10style?: CSSProperties;11}12export default function GithubAvatar({ style, size = 195 / 2, name }: Props) {13const url = `https://github.com/${name}`;14return (15<Tooltip16title={`Open the GitHub pag ${url} in a new tab.`}17placement="left"18>19<div style={{ textAlign: "center", ...style }}>20<A href={url}>21<Avatar22style={{ borderRadius: "7.5px", border: "1px solid #eee" }}23shape="square"24size={size}25icon={<img src={`https://avatars.githubusercontent.com/${name}`} />}26/>27<div>28<Icon name="external-link" /> {trunc(name, 28)}{" "}29<Icon name="github" />30</div>31</A>32</div>33</Tooltip>34);35}363738