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'; |
| 8 | |
| 9 | const ForumPage = () => { |
| 10 | const [searchQuery, setSearchQuery] = useState(''); |
| 11 | |
| 12 | const handleSearch = (query) => { |
| 13 | setSearchQuery(query); |
| 14 | }; |
| 15 | |
| 16 | return ( |
| 17 | <div className="forum-page"> |
| 18 | <Header /> |
| 19 | <div className="toolbar"> |
Krishya | 7ec1dd0 | 2025-04-19 15:29:03 +0800 | [diff] [blame] | 20 | <CreatePostButton /> |
Krishya | 1300cad | 2025-04-20 22:16:45 +0800 | [diff] [blame] | 21 | <SearchBar onSearch={handleSearch} /> |
| 22 | |
Krishya | 7ec1dd0 | 2025-04-19 15:29:03 +0800 | [diff] [blame] | 23 | </div> |
| 24 | <PostList search={searchQuery} /> |
| 25 | </div> |
| 26 | ); |
| 27 | }; |
| 28 | |
| 29 | export default ForumPage; |
| 30 | |