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 PathCard from "@web/src/components/models/post/SubPost/PathCard";

export default function MyPathListContainer() {
	const { user } = useAuth();
	const { searchCondition, termsCondition } = useMainContext();
	return (
		<>
			<PostList
				renderItem={(post) => <PathCard post={post}></PathCard>}
				params={{
					pageSize: 12,
					where: {
						type: PostType.PATH,
						students: {
							some: {
								id: user?.id,
							},
						},
						deletedAt: null,
						...termsCondition,
						...searchCondition,
					},
				}}
				cols={4}></PostList>
		</>
	);
}
