import React, { useState, useEffect, useRef } from "react"; import LessonPlayList from "./LessonPlayList"; import Attachments from "./Attachments"; import Book from "./Book"; import Comment from "./Comment"; import AddComment from "./AddComment"; import Video from "../../../components/JolPlayer"; import listIcon from "../../assets/icons/list.png"; import { connect } from "react-redux"; import _ from "lodash"; import scroll from "../../../utils/scroll.js"; import location from "../../../utils/location.js"; import { book, publicApi } from "../../redux/actions"; import Loader from "../../components/Loader"; function VodTube({ selectedVideo, info, bookSection, loading, getInfo, categories, setVideoActive, allBooks, theme, }) { const videoListTag = useRef(null); useEffect(() => { localStorage.setItem("scroll-list", "on"); scroll.goToTop(); getInfo({ bookId: localStorage.getItem("bookId") ? localStorage.getItem("bookId") : localStorage.getItem("category")?.split(",")[0], }); }, []); useEffect(() => { if (allBooks && localStorage.getItem("category")) { const cat = localStorage.getItem("category")?.split(","); bookSection({ bookId: cat[0], categoryId: cat[1] }); } }, [allBooks]); const light = theme === "light"; return ( <>
{/* */}

نظرات

{info?.comments?.map((comment, i) => ( ))}

{localStorage.getItem("category")?.split(",")[1] || "لیست فیلم‌ها"}

{/*

در این قسمت توضیحی کوتاه قرار می گیرد

*/}
{localStorage.getItem("bookId") ? categories?.map((video, i) => ( )) : info?.vods.map((video, i) => ( ))}
{info?.attachments.length > 0 && (

فایل پیوست تمارین این فصل

{/*

در این قسمت توضیحی کوتاه قرار می گیرد

*/}
{info?.attachments?.map((file, i) => ( ))}
)} {info?.related && (

پیشنهاد دانوین برای شما

تا 50% تخفیف
{info?.related.slice(0, 3).map((item, i) => ( ))}
)}

نظرات

{info?.comments?.map((comment, i) => ( ))}
{loading && (
)} ); } export default connect( (state) => ({ selectedVideo: state.publicApi.selectedVideo, info: state.publicApi.bookSection, loading: state.publicApi.loading, categories: state.publicApi.categories, allBooks: state.publicApi.bookInfo?.vods, theme: state.publicApi.theme, }), { getInfo: publicApi.bookInfo, getBookList: book.list, bookSection: publicApi.bookSection, setVideoActive: publicApi.setVideoActive, } )(VodTube);