Krishya | 7ec1dd0 | 2025-04-19 15:29:03 +0800 | [diff] [blame^] | 1 | import React from 'react'; |
| 2 | import { useLocation } from 'wouter'; |
| 3 | import { Edit } from '@icon-park/react'; |
| 4 | import './CreatePostButton.css'; |
| 5 | |
| 6 | const CreatePostButton = () => { |
| 7 | const [, navigate] = useLocation(); |
| 8 | |
| 9 | const goToCreatePost = () => { |
| 10 | navigate('/forum/create-post'); |
| 11 | }; |
| 12 | |
| 13 | return ( |
| 14 | <div className="create-post"> |
| 15 | <button onClick={goToCreatePost} className="create-btn"> |
| 16 | <Edit theme="outline" size="18" /> 发帖 |
| 17 | </button> |
| 18 | </div> |
| 19 | ); |
| 20 | }; |
| 21 | |
| 22 | export default CreatePostButton; |