mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-03-28 11:13:16 +00:00
11 lines
394 B
TypeScript
11 lines
394 B
TypeScript
"use client";
|
|
|
|
import Image, { ImageProps } from "next/image";
|
|
import { useState } from "react";
|
|
|
|
export default function ProfilePicture(props: Partial<ImageProps>) {
|
|
const { src, ...rest } = props;
|
|
const [imgSrc, setImgSrc] = useState(src);
|
|
|
|
return <Image width={128} height={128} {...rest} src={imgSrc || "/guest.png"} alt={"profile picture"} onError={() => setImgSrc("/guest.png")} />;
|
|
}
|