/*
* 骨架屏
*/
import React from 'react'
import { View } from '@tarojs/components'
import './index.scss'

export default function Skeleton(props) {
  const { length } = props

  const render = () => {
    let node = []
    for (let i = 0; i < length; i++) {
      node.push(
        <View className='skeleton'>
          <View className='ul'>
            <View className='li' />
            <View className='li' />
            <View className='li' />
            <View className='li' />
            <View className='li' />
            <View className='li' />
          </View>
        </View>
      )
    }
    return node
  }

  return (
    <View>
      {render()}
    </View>
  )
}
