import React, { useEffect, useState } from 'react' import { Box, NoData } from '$components'; import { Select } from 'antd'; import './style.less'; const { Option } = Select; function DataTop5(props) { const { structures, accessToken, videoList } = props; const [showVideoList, setShowVideoList] = useState(); useEffect(() => { if (videoList.length && structures.length && accessToken) { if (!showVideoList) { setShowVideoList(recUrlToLiveUrl(videoList[0]?.url)) } } }, [videoList, accessToken]) const renderSubtitle = () => ( videoList?.length > 0 && { setShowVideoList(recUrlToLiveUrl(value)); }} > {videoList.map(s => {s.name})} ); return {showVideoList ? {videoList?.find(s => s?.url == showVideoList)?.name} : } } export default DataTop5; function recUrlToLiveUrl(url) { if (!url) return undefined; return url.replace('.rec', '.live'); }