collect-system/apps/web/src/app/main/courses/components/CoursesContainer.tsx

26 lines
665 B
TypeScript
Raw Normal View History

2025-02-25 20:40:34 +08:00
import { useMainContext } from "../../layout/MainProvider";
import { PostType, Prisma } from "@nice/common";
2025-02-26 23:18:14 +08:00
import PostList from "@web/src/components/models/course/list/PostList";
2025-02-27 13:32:33 +08:00
import CourseCard from "@web/src/components/models/post/SubPost/CourseCard";
2025-02-25 20:40:34 +08:00
export function CoursesContainer() {
2025-02-27 13:32:33 +08:00
const { searchCondition, termsCondition } = useMainContext();
2025-02-25 20:40:34 +08:00
return (
<>
2025-02-26 23:18:14 +08:00
<PostList
2025-02-27 13:32:33 +08:00
renderItem={(post) => <CourseCard post={post}></CourseCard>}
2025-02-25 20:40:34 +08:00
params={{
pageSize: 12,
where: {
type: PostType.COURSE,
2025-02-27 10:23:36 +08:00
...termsCondition,
2025-02-27 08:25:34 +08:00
...searchCondition,
2025-02-25 20:40:34 +08:00
},
}}
2025-02-26 23:18:14 +08:00
cols={4}></PostList>
2025-02-25 20:40:34 +08:00
</>
);
}
export default CoursesContainer;