import React, { useCallback, useEffect, useState } from "react"; import { useDispatch } from "react-redux"; import Spotlight from "@enact/spotlight"; import { updatePanel } from "../../../../actions/panelActions"; import TVirtualGridList from "../../../../components/TVirtualGridList/TVirtualGridList"; import { LOG_MENU, panel_names } from "../../../../utils/Config"; import ListEmptyContents from "../../../ImagePanel/ImageSideContents/ListEmptyContents/ListEmptyContents"; import PlayerItemCard, { TYPES } from "../../PlayerItemCard/PlayerItemCard"; import css from "./LiveChannelContents.module.less"; export default function LiveChannelContents({ liveInfos, selectedIndex, setSelectedIndex, tabIndex, handleItemFocus, }) { const dispatch = useDispatch(); const handleFocus = useCallback( () => () => { if (handleItemFocus) { handleItemFocus(LOG_MENU.FULL_LIVE_CHANNELS); } }, [handleItemFocus] ); const renderItem = useCallback( ({ index, ...rest }) => { const { dfltThumbnailImgPath, patncLogoPath, prdtId, patnrId, showId, showNm, patncNm, strtDt, endDt, timezone, thumbnailUrl, } = liveInfos[index]; const handleItemClick = () => { setSelectedIndex(index); dispatch( updatePanel({ name: panel_names.PLAYER_PANEL, panelInfo: { patnrId, showId, shptmBanrTpNm: "LIVE" }, }) ); }; return ( ); }, [liveInfos, dispatch, handleFocus] ); return ( <>
{liveInfos && liveInfos.length > 0 ? ( ) : ( )}
); }