aff
This commit is contained in:
parent
8d0a79646c
commit
82048a115e
|
@ -1,33 +1,21 @@
|
||||||
import { useEffect } from "react";
|
import { useContext, useEffect } from "react";
|
||||||
import { CoursePreviewMsg } from "@web/src/app/main/course/preview/type.ts";
|
import { CoursePreviewMsg } from "@web/src/app/main/course/preview/type.ts";
|
||||||
import { Button, Tabs, Image, Skeleton } from "antd";
|
import { Button, Tabs, Image, Skeleton } from "antd";
|
||||||
import type { TabsProps } from "antd";
|
import type { TabsProps } from "antd";
|
||||||
import { PlayCircleOutlined } from "@ant-design/icons";
|
import { PlayCircleOutlined } from "@ant-design/icons";
|
||||||
export function CoursePreviewAllmsg({
|
import { CourseDetailContext } from "../CourseDetailContext";
|
||||||
previewMsg,
|
export function CoursePreview() {
|
||||||
items,
|
|
||||||
isLoading,
|
|
||||||
}: {
|
|
||||||
previewMsg?: CoursePreviewMsg;
|
|
||||||
items: TabsProps["items"];
|
|
||||||
isLoading: boolean;
|
|
||||||
}) {
|
|
||||||
useEffect(() => {
|
|
||||||
console.log(previewMsg);
|
|
||||||
});
|
|
||||||
const TapOnChange = (key: string) => {
|
const TapOnChange = (key: string) => {
|
||||||
console.log(key);
|
console.log(key);
|
||||||
};
|
};
|
||||||
|
const { course, isLoading, lecture, lectureIsLoading, selectedLectureId } =
|
||||||
|
useContext(CourseDetailContext);
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen max-w-7xl mx-auto px-6 lg:px-8">
|
<div className="min-h-screen max-w-7xl mx-auto px-6 lg:px-8">
|
||||||
<div className="overflow-auto flex justify-around align-items-center w-full mx-auto my-8">
|
<div className="overflow-auto flex justify-around align-items-center w-full mx-auto my-8">
|
||||||
<div className="relative w-[600px] h-[340px] m-4 overflow-hidden flex justify-center items-center">
|
<div className="relative w-[600px] h-[340px] m-4 overflow-hidden flex justify-center items-center">
|
||||||
<Image
|
<Image
|
||||||
src={
|
src={isLoading ? "error" : course?.meta?.thumbnail}
|
||||||
previewMsg.isLoading
|
|
||||||
? "error"
|
|
||||||
: previewMsg.videoPreview
|
|
||||||
}
|
|
||||||
alt="example"
|
alt="example"
|
||||||
preview={false}
|
preview={false}
|
||||||
className="w-full h-full object-cover z-0"
|
className="w-full h-full object-cover z-0"
|
||||||
|
@ -43,13 +31,13 @@ export function CoursePreviewAllmsg({
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<span className="text-3xl font-bold my-3 ">
|
<span className="text-3xl font-bold my-3 ">
|
||||||
{previewMsg.Title}
|
{course.title}
|
||||||
</span>
|
</span>
|
||||||
<span className="text-xl font-semibold my-3 text-gray-700">
|
<span className="text-xl font-semibold my-3 text-gray-700">
|
||||||
{previewMsg.SubTitle}
|
{course.subTitle}
|
||||||
</span>
|
</span>
|
||||||
<span className="text-lg font-light my-3 text-gray-500 text-clip">
|
<span className="text-lg font-light my-3 text-gray-500 text-clip">
|
||||||
{previewMsg.Description}
|
{course.Description}
|
||||||
</span>
|
</span>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
Loading…
Reference in New Issue