import React, { useState, useEffect } from "react"; import Navbar from "../../components/Navbar"; import Footer from "../Home/Footer"; 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 "./index.scss"; import listIcon from "../../assets/icons/list.png"; import { connect } from "react-redux"; import scroll from "../../util/scroll.js"; import { book, publicApi } from "../../redux/actions"; import Loader from "../../components/Loader"; function VodTube({ selectedVideo, info, bookSection, loading, getInfo, categories, setVideoActive, }: any) { useEffect(() => { scroll.goToTop(); // getInfo({ // bookId: 1, // // window.location.pathname.slice( // // window.location.pathname.lastIndexOf("/") + 1, // // window.location.pathname.length // // ), // }); getInfo({ bookId: localStorage.getItem("bookId") }); }, []); useEffect(() => { if (localStorage.getItem("bookId")) { setVideoActive(categories[0][0]); } else { if (!info) { const cat: any = localStorage.getItem("category")?.split(","); bookSection({ bookId: cat[0], categoryId: cat[1] }); } } }, [info]); return ( <>
{/* */}

نظرات

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

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

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

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

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

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

{info?.attachments?.map((file: any, i: any) => ( ))}
)}

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

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

نظرات

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