2023-11-06 19:01:16 -05:00
|
|
|
import cx from "classnames"
|
2023-10-25 17:58:53 -04:00
|
|
|
import React from "react"
|
|
|
|
|
2023-11-06 19:01:16 -05:00
|
|
|
export default function ProfilePic({
|
|
|
|
url,
|
|
|
|
size = "medium",
|
|
|
|
}: {
|
|
|
|
url: string
|
|
|
|
size?: "small" | "medium"
|
|
|
|
}) {
|
2023-10-25 17:58:53 -04:00
|
|
|
return (
|
2023-11-06 19:01:16 -05:00
|
|
|
<div
|
|
|
|
className={cx("relative flex-shrink-0 rounded-full overflow-hidden", {
|
|
|
|
"w-5 h-5": size === "small",
|
|
|
|
"w-8 h-8": size === "medium",
|
|
|
|
})}
|
|
|
|
>
|
2023-10-25 17:58:53 -04:00
|
|
|
{url ? (
|
|
|
|
<div
|
2023-11-06 19:01:16 -05:00
|
|
|
className="w-full h-full flex pointer-events-none rounded-full bg-gray-200"
|
2023-10-25 17:58:53 -04:00
|
|
|
style={{
|
|
|
|
backgroundImage: `url(${url})`,
|
|
|
|
backgroundSize: "cover",
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
) : (
|
2023-11-06 19:01:16 -05:00
|
|
|
<div className="w-full h-full flex pointer-events-none rounded-full border border-gray-400 border-dashed" />
|
2023-10-25 17:58:53 -04:00
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|