UNPKG

723 BJavaScriptView Raw
1import React from "react";
2import { PictureOutlined } from "@ant-design/icons";
3import getSrcPrefix from "@script/getSrcPrefix";
4import showImage from "@script/showImage";
5/**
6 * ----------------------------------------
7 * 图片占位符
8 * 点击全屏显示图片
9 * @param {String} src - 图片地址
10 * ----------------------------------------
11 */
12export default function ImageHolder({ src }) {
13 if (!src) return null;
14 const path = getSrcPrefix(src);
15 return (
16 <PictureOutlined
17 onClick={() => showImage(path)}
18 style={{
19 marginLeft: "6px",
20 color: "#08a1e8",
21 cursor: "pointer",
22 fontSize: "17px",
23 position: "relative",
24 top: "2px",
25 }}
26 />
27 );
28}