2025-02-27 12:21:49 +08:00
|
|
|
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">
|
2025-02-27 22:37:09 +08:00
|
|
|
<h3 className="text-lg font-medium mb-4">只搜索</h3>
|
2025-02-27 12:21:49 +08:00
|
|
|
<Radio.Group
|
|
|
|
value={searchMode}
|
|
|
|
onChange={handleModeChange}
|
|
|
|
buttonStyle="solid">
|
2025-02-27 22:37:09 +08:00
|
|
|
<Radio.Button value={PostType.COURSE}>视频课程</Radio.Button>
|
|
|
|
<Radio.Button value={PostType.PATH}>思维导图</Radio.Button>
|
|
|
|
<Radio.Button value="both">所有资源</Radio.Button>
|
2025-02-27 12:21:49 +08:00
|
|
|
</Radio.Group>
|
|
|
|
</Space>
|
|
|
|
);
|
|
|
|
}
|