import { Image, View } from '@tarojs/components'
import { memo } from 'react'
import style from './index.module.scss'
import Loading from '@/components/loading'
import Empty from '@/components/empty'

interface Params {
  title?: string
  loadingIcon?: boolean
}
const LoadingCard = (props: Params) => {
  console.log(props)
  const {
    title = '加载中...', // 显示的文字
    loadingIcon = true, // 是否显示加载图标
  } = props
  console.log('loadingCard:::', props)
  return (
    <>
      <View className={style.loadingCard_main}>
        {loadingIcon && <Loading />}
        {!loadingIcon && <Image className={style.pic} mode="aspectFill" lazyLoad src="https://cdn.zzfzyc.com/empty.png"></Image>}
        <View className={style.loading_text}>{title}</View>
      </View>
    </>
  )
}
export default memo(LoadingCard)
