aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/components/UserIcon.tsx
blob: 9c57c426f5a30437bfff17e99c53f9f307bdddbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { BASE_PATH } from "../config";

type Props = {
  iconPath: string;
  displayName: string;
  className: string;
};

export default function UserIcon({ iconPath, displayName, className }: Props) {
  return (
    <img
      src={
        process.env.NODE_ENV === "development"
          ? `http://localhost:8007${BASE_PATH}${iconPath}`
          : `${BASE_PATH}${iconPath}`
      }
      alt={`${displayName} のアイコン`}
      className={`rounded-full border-4 border-white ${className}`}
    />
  );
}