import React, { Component } from "react";
import axios from "axios";
import ReactPlayer from "react-player";
export default class DoctorData extends Component {
state = {
sidebarOpen: true,
courseData: [],
renderData: []
};
componentDidMount() {
let jwtToken = { accessToken: "" };
axios.post(" ", jwtToken).then(data => {
console.log(data);
this.setState({
courseData: data.data.courseDetails.userModuleDetailsV2
});
});
}
RenderComponent = () => {
console.log("we are inside sideBarComponet");
return (
<div className="card">
{this.state.courseData.map((value, key) => {
console.log(value);
console.log("we are inside key", key);
// console.log(value.userLessonDetails[key].userChapterDetails[0].chapter.content)
return (
<div>
<div className="card-header">
<h4>Doctor-content</h4>
<ReactPlayer
url={
value.userLessonDetails[0].userChapterDetails[0].chapter
.content
}
playing
/>
{console.log(
"we are printing the content",
value.userLessonDetails[0].userChapterDetails[0].chapter
.content
)}
{console.log(typeof this.state.courseData)}
</div>
</div>
);
})}
</div>
);
};
render() {
return (
<div>
{this.state.courseData.length ? (
<div>{this.RenderComponent()}</div>
) : null}
{console.log("fghjkl", this.state.courseData)}
{this.state.courseData.length}
</div>
);
}
}
皈依舞
米脂
相关分类