1 | import React from "react";
|
2 | import showImage from "../script/previewImage";
|
3 | const WIDTH = 270;
|
4 | const HEIGHT = 150;
|
5 |
|
6 | export default function CustomImage({ src, width, height }) {
|
7 | const onClick = () => {
|
8 | showImage(src);
|
9 | };
|
10 | return (
|
11 | <img
|
12 | width={width || WIDTH}
|
13 | height={height || HEIGHT}
|
14 | style={{ objectFit: "cover", cursor: "pointer" }}
|
15 | src={src}
|
16 | onClick={onClick}
|
17 | preview={true}
|
18 | />
|
19 | );
|
20 | }
|