import PostList from "@web/src/components/models/course/list/PostList";
import { useAuth } from "@web/src/providers/auth-provider";
import { PostType } from "@nice/common";
import { useMainContext } from "../../layout/MainProvider";
import PostCard from "@web/src/components/models/post/PostCard";
import CourseCard from "@web/src/components/models/post/SubPost/CourseCard";

export default function MyDutyListContainer() {
	const { user } = useAuth();
	const { searchCondition, termsCondition } = useMainContext();
	return (
		<>
			<PostList
				renderItem={(post) => <CourseCard post={post}></CourseCard>}
				params={{
					pageSize: 12,
					where: {
						type: PostType.COURSE,
						authorId: user.id,
						...termsCondition,
						...searchCondition,
					},
				}}
				cols={4}></PostList>
		</>
	);
}
