import type { IObjectAny } from '@schema-render/core-react' import { Image, Space } from 'antd' import type { FC } from 'react' import { useState } from 'react' interface IProps { imgList: string[] imgProps?: IObjectAny groupProps?: IObjectAny } const ImagesPreview: FC = ({ imgList, imgProps, groupProps }) => { const [visible, setVisible] = useState(false) const [current, setCurrent] = useState(0) const openPreview = (index: number) => { setCurrent(index) setVisible(true) } return ( setCurrent(cur), onVisibleChange: (val) => setVisible(val), }} > {imgList.map((imgUrl, i) => ( openPreview(i)} /> ))} ) } export default ImagesPreview