import PostList from "@web/src/components/models/course/list/PostList";
import { useMainContext } from "../../layout/MainProvider";
import PathCard from "../../path/components/PathCard";
import { useEffect } from "react";
export default function SearchListContainer() {
	const { searchCondition, termsCondition, searchMode } = useMainContext();

	return (
		<>
			<PostList
				renderItem={(post) => <PathCard path={post}></PathCard>}
				params={{
					pageSize: 12,
					where: {
						type: searchMode === "both" ? undefined : searchMode,
						...termsCondition,
						...searchCondition,
					},
				}}
				cols={4}></PostList>
		</>
	);
}
