Initial commit

This commit is contained in:
2025-10-11 11:55:25 +08:00
parent 467dad8449
commit 8107dee8d3
2879 changed files with 610575 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
// src/views/Community/components/SearchBox.js
import React from 'react';
import { Card, Input, Radio, Form, Button } from 'antd';
import { SearchOutlined } from '@ant-design/icons';
const SearchBox = ({ onSearch }) => {
const [form] = Form.useForm();
const handleSubmit = (values) => {
onSearch(values);
};
return (
<Card title="搜索事件" className="search-box" style={{ marginBottom: 16 }}>
<Form
form={form}
onFinish={handleSubmit}
initialValues={{ search_type: 'topic' }}
>
<Form.Item name="q" style={{ marginBottom: 12 }}>
<Input.Search
placeholder="搜索关键词..."
allowClear
enterButton={<SearchOutlined />}
onSearch={(value) => {
form.setFieldsValue({ q: value });
form.submit();
}}
/>
</Form.Item>
<Form.Item name="search_type" style={{ marginBottom: 12 }}>
<Radio.Group>
<Radio value="topic">搜索话题</Radio>
<Radio value="stock">搜索股票</Radio>
</Radio.Group>
</Form.Item>
<Form.Item style={{ marginBottom: 0 }}>
<Button type="primary" htmlType="submit" block>
搜索
</Button>
</Form.Item>
</Form>
</Card>
);
};
export default SearchBox;