import React, { useEffect } from 'react' import { useDispatch, useSelector } from 'react-redux' import { useParams } from 'react-router-dom' import VideoCard from '../components/VideoCard' import { getChannelVideos, getChannelDetails } from '../redux/channelSlice' import convertToInternationalCurrencySystem from '../utils/convert' import timeSince from '../utils/date' function ChannelDetails() { const { id } = useParams() const dispatch = useDispatch() const { sidebarExtend } = useSelector((state) => state.category) const { channelDetails } = useSelector((state) => state.channel) const { channelVideos } = useSelector((state) => state.channel) var aDay = 24 * 60 * 60 * 1000; console.log(channelDetails.snippet) useEffect(() => { dispatch(getChannelVideos(`search?channelId=${id}&part=snippet&order=date`)) dispatch(getChannelDetails(`channels?part=snippet&id=${id}`)) }, [id,dispatch]) console.log(window.innerWidth) return ( <>
{/* */}

{channelDetails?.snippet?.title}

{channelDetails?.snippet?.customUrl} {convertToInternationalCurrencySystem(channelDetails?.statistics?.subscriberCount)}

VIDEOS

{ channelVideos.map((e, index) => { return ( ) }) }
) } export default ChannelDetails