15 lines
412 B
TypeScript
15 lines
412 B
TypeScript
import { CourseDto, PostDto } from "@nice/common";
|
|
import { useNavigate } from "react-router-dom";
|
|
import PostCard from "../PostCard";
|
|
export default function CourseCard({ post }: { post: PostDto }) {
|
|
const navigate = useNavigate();
|
|
return (
|
|
<PostCard
|
|
post={post}
|
|
onClick={() => {
|
|
navigate(`/course/${post?.id}/detail`);
|
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
}}></PostCard>
|
|
);
|
|
}
|