2025-02-26 23:01:58 +08:00
|
|
|
import { useContext } from "react";
|
|
|
|
import { CourseDetailContext } from "./CourseDetailContext";
|
|
|
|
import { useNavigate } from "react-router-dom";
|
2025-02-27 09:05:29 +08:00
|
|
|
import {
|
|
|
|
BookOutlined,
|
|
|
|
CalendarOutlined,
|
|
|
|
EditTwoTone,
|
|
|
|
EyeOutlined,
|
|
|
|
ReloadOutlined,
|
|
|
|
} from "@ant-design/icons";
|
2025-02-26 23:01:58 +08:00
|
|
|
import dayjs from "dayjs";
|
2025-02-27 09:05:29 +08:00
|
|
|
import CourseOperationBtns from "./JoinLearingButton";
|
2025-02-26 23:01:58 +08:00
|
|
|
|
|
|
|
export default function CourseDetailTitle() {
|
2025-02-27 21:45:40 +08:00
|
|
|
const { course } = useContext(CourseDetailContext);
|
2025-02-26 23:01:58 +08:00
|
|
|
return (
|
|
|
|
<div className="flex justify-center flex-col items-center gap-2 w-full my-2 px-6">
|
|
|
|
<div className="flex justify-start w-full text-2xl font-bold">
|
|
|
|
{course?.title}
|
|
|
|
</div>
|
2025-02-27 21:45:40 +08:00
|
|
|
<div className="text-gray-600 flex w-full justify-start items-center gap-5">
|
|
|
|
{course?.author?.showname && (
|
|
|
|
<div>
|
|
|
|
发布者:
|
|
|
|
{course?.author?.showname}
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
{course?.depts && course?.depts?.length > 0 && (
|
|
|
|
<div>
|
|
|
|
发布单位:
|
|
|
|
{course?.depts?.map((dept) => dept.name)}
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</div>
|
2025-02-27 09:05:29 +08:00
|
|
|
<div className="text-gray-600 flex w-full justify-start items-center gap-5">
|
2025-02-26 23:01:58 +08:00
|
|
|
<div className="flex gap-1">
|
|
|
|
<CalendarOutlined></CalendarOutlined>
|
2025-02-27 21:45:40 +08:00
|
|
|
{"发布于:"}
|
2025-02-26 23:01:58 +08:00
|
|
|
{dayjs(course?.createdAt).format("YYYY年M月D日")}
|
|
|
|
</div>
|
|
|
|
<div className="flex gap-1">
|
2025-02-27 21:45:40 +08:00
|
|
|
{"最后更新:"}
|
2025-02-26 23:01:58 +08:00
|
|
|
{dayjs(course?.updatedAt).format("YYYY年M月D日")}
|
|
|
|
</div>
|
|
|
|
<div className="flex gap-1">
|
|
|
|
<EyeOutlined></EyeOutlined>
|
2025-02-27 22:58:42 +08:00
|
|
|
<div>{`播放次数${course?.meta?.views || 0}`}</div>
|
2025-02-26 23:01:58 +08:00
|
|
|
</div>
|
|
|
|
<div className="flex gap-1">
|
|
|
|
<BookOutlined />
|
|
|
|
<div>{`学习人数${course?.studentIds?.length || 0}`}</div>
|
|
|
|
</div>
|
2025-02-27 09:05:29 +08:00
|
|
|
<CourseOperationBtns />
|
2025-02-26 23:01:58 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|