mirror of https://github.com/usememos/memos
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
510 B
TypeScript
24 lines
510 B
TypeScript
import showPreviewImageDialog from "./PreviewImageDialog";
|
|
import "../less/image.less";
|
|
|
|
interface Props {
|
|
imgUrl: string;
|
|
className?: string;
|
|
}
|
|
|
|
const Image: React.FC<Props> = (props: Props) => {
|
|
const { className, imgUrl } = props;
|
|
|
|
const handleImageClick = () => {
|
|
showPreviewImageDialog(imgUrl);
|
|
};
|
|
|
|
return (
|
|
<div className={"image-container " + className} onClick={handleImageClick}>
|
|
<img src={imgUrl} decoding="async" loading="lazy" />
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default Image;
|