import { useRequest } from 'ahooks'; import { Empty, Spin } from 'antd'; import classNames from 'classnames'; import React, { useEffect, useState } from 'react'; import Icon, { IconImg } from '../../../components/Icon'; import Truly from '../../../components/Truly'; import styles from './index.less'; import { FileFields, getListApi } from '../services'; interface FileImageSelectProps { onSelect: (pick: FileFields) => void; picType: string; } const FileImageSelect: React.FC = ({ onSelect, picType, }) => { const [type] = useState('0'); const { data: fileList, loading: getFileListLoading, run: getFileListRun, } = useRequest(getListApi, { manual: true, }); useEffect(() => { getFileListRun({ type, picType }); }, [picType, type, getFileListRun]); return (
0} falsyRender={} >
{(fileList || []).map((item) => { return (
{ onSelect(item); }} > } > svg
); })}
); }; export default FileImageSelect;