import ColVideo from '@/components/col-video'
import { defineComponent } from 'vue'
import styles from './index.module.less'
import videoBg from '@/common/images/video_default.png'
import ColResult from '@/components/col-result'

export default defineComponent({
  name: 'VideoList',
  props: {
    list: {
      type: Array,
      default: []
    }
  },
  render() {
    return (
      <div class={styles.videoList}>
        <div class={styles.videoTitle}>
          <i></i>视频列表
        </div>
        {this.list.length > 0 ? (
          <div class={styles.videoSection}>
            {this.list.map((item: any, index: number) => (
              <div class={styles.videoItem}>
                <ColVideo
                  poster={videoBg}
                  src={item.url}
                  preload="none"
                  height="82px"
                  currentTime={false}
                />
                <p>{item.startTime}</p>
              </div>
            ))}
          </div>
        ) : (
          <ColResult btnStatus={false} classImgSize="SMALL" tips="暂无视频" />
        )}
      </div>
    )
  }
})
