Krishya | 7ec1dd0 | 2025-04-19 15:29:03 +0800 | [diff] [blame] | 1 | |
| 2 | import React, { useState } from 'react'; |
| 3 | import Header from '../../../components/Header'; |
| 4 | import SearchBar from './components/SearchBar'; |
| 5 | import CreatePostButton from './components/CreatePostButton'; |
| 6 | import PostList from './components/PostList'; |
| 7 | import './ForumPage.css'; |
Krishya | f1d0ea8 | 2025-05-03 17:01:58 +0800 | [diff] [blame^] | 8 | import Promotion from '../promotion-part/Promotion'; |
Krishya | 7ec1dd0 | 2025-04-19 15:29:03 +0800 | [diff] [blame] | 9 | |
| 10 | const ForumPage = () => { |
| 11 | const [searchQuery, setSearchQuery] = useState(''); |
| 12 | |
| 13 | const handleSearch = (query) => { |
| 14 | setSearchQuery(query); |
| 15 | }; |
| 16 | |
| 17 | return ( |
| 18 | <div className="forum-page"> |
| 19 | <Header /> |
Krishya | f1d0ea8 | 2025-05-03 17:01:58 +0800 | [diff] [blame^] | 20 | <Promotion /> |
Krishya | 7ec1dd0 | 2025-04-19 15:29:03 +0800 | [diff] [blame] | 21 | <div className="toolbar"> |
Krishya | 7ec1dd0 | 2025-04-19 15:29:03 +0800 | [diff] [blame] | 22 | <CreatePostButton /> |
Krishya | c0f7e9b | 2025-04-22 15:28:28 +0800 | [diff] [blame] | 23 | <SearchBar onSearch={handleSearch} /> |
Krishya | 7ec1dd0 | 2025-04-19 15:29:03 +0800 | [diff] [blame] | 24 | </div> |
| 25 | <PostList search={searchQuery} /> |
| 26 | </div> |
| 27 | ); |
| 28 | }; |
| 29 | |
| 30 | export default ForumPage; |
| 31 | |