34 lines
895 B
JavaScript
34 lines
895 B
JavaScript
import React from "react";
|
|
import { Image } from "antd-mobile";
|
|
export default function OwnImage({
|
|
src,
|
|
width = "100%",
|
|
height = "100%",
|
|
className,
|
|
roundedFull,
|
|
...others
|
|
}) {
|
|
return (
|
|
<div className="flex flex-col justify-center items-center relative">
|
|
<div className={`${className}`}>
|
|
<Image
|
|
height={height}
|
|
width={width}
|
|
fit="cover"
|
|
src={src}
|
|
className={roundedFull ? "rounded-full" : ""}
|
|
// placeholder=""
|
|
fallback={
|
|
<div className="w-full h-full bg-gray-500 absolute top-0 z-0 animate-pulse" />
|
|
}
|
|
placeholder={
|
|
<div className="w-full h-full bg-gray-700 absolute top-0 z-0 animate-pulse" />
|
|
}
|
|
{...others}
|
|
/>
|
|
<div className="w-full h-full bg-transparent absolute top-0 z-20" />
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|