import { useMainContext } from "../MainProvider";
import { Radio, Space, Typography } from "antd";
import { PostType } from "@nice/common"; // Assuming PostType is defined in this path

export default function SearchModeRadio() {
	const { searchMode, setSearchMode } = useMainContext();

	const handleModeChange = (e) => {
		setSearchMode(e.target.value);
	};

	return (
		<Space direction="vertical" align="start" className="mb-2">
			<h3 className="text-lg font-medium mb-4">只搜索</h3>
			<Radio.Group
				value={searchMode}
				onChange={handleModeChange}
				buttonStyle="solid">
				<Radio.Button value={PostType.COURSE}>视频课程</Radio.Button>
				<Radio.Button value={PostType.PATH}>思维导图</Radio.Button>
				<Radio.Button value="both">所有资源</Radio.Button>
			</Radio.Group>
		</Space>
	);
}
