|
1 | 1 | // FilterBar.tsx
|
2 | 2 | import * as React from 'react';
|
3 | 3 | import FilterSelector from './FilterSelector'; // Import your FilterSelector component
|
4 |
| -import { Box, Button } from '@mui/material'; |
| 4 | +import { Box, Button, Grid, Typography } from '@mui/material'; |
5 | 5 |
|
6 | 6 | interface FilterBarProps {
|
7 | 7 | categoryOptions: { value: number; label: string }[];
|
@@ -30,13 +30,54 @@ const FilterBar: React.FC<FilterBarProps> = ({
|
30 | 30 | };
|
31 | 31 |
|
32 | 32 | return (
|
33 |
| - <Box sx={{paddingX: 2, paddingY: 1}}> |
34 |
| - <FilterSelector options={categoryOptions} selectedValues={selectedCategories} onChange={setSelectedCategories} /> |
35 |
| - <FilterSelector options={difficultyOptions} selectedValues={selectedDifficulties} onChange={setSelectedDifficulties} /> |
36 |
| - <Button onClick={handleApplyFilters}>Apply Filters</Button> |
37 |
| - <Button onClick={handleResetFilters}>Reset Filters</Button> |
| 33 | + <Box sx={{ padding: 2 }}> |
| 34 | + <Grid container spacing={2}> |
| 35 | + <Grid item> |
| 36 | + <Box> |
| 37 | + <Typography variant="h6" gutterBottom> |
| 38 | + Category |
| 39 | + </Typography> |
| 40 | + <FilterSelector |
| 41 | + options={categoryOptions} |
| 42 | + selectedValues={selectedCategories} |
| 43 | + onChange={setSelectedCategories} |
| 44 | + /> |
| 45 | + </Box> |
| 46 | + </Grid> |
| 47 | + <Grid item> |
| 48 | + <Box> |
| 49 | + <Typography variant="h6" gutterBottom> |
| 50 | + Difficulty |
| 51 | + </Typography> |
| 52 | + <FilterSelector |
| 53 | + options={difficultyOptions} |
| 54 | + selectedValues={selectedDifficulties} |
| 55 | + onChange={setSelectedDifficulties} |
| 56 | + /> |
| 57 | + </Box> |
| 58 | + </Grid> |
| 59 | + <Grid item> |
| 60 | + <Button |
| 61 | + onClick={handleApplyFilters} |
| 62 | + variant="contained" |
| 63 | + className="bg-blue-400" |
| 64 | + > |
| 65 | + Apply Filters |
| 66 | + </Button> |
| 67 | + </Grid> |
| 68 | + <Grid item> |
| 69 | + <Button |
| 70 | + onClick={handleResetFilters} |
| 71 | + variant="contained" |
| 72 | + className="bg-blue-400" |
| 73 | + > |
| 74 | + Reset Filters |
| 75 | + </Button> |
| 76 | + </Grid> |
| 77 | + </Grid> |
38 | 78 | </Box>
|
39 |
| - ); |
| 79 | + |
| 80 | + ); |
40 | 81 | };
|
41 | 82 |
|
42 | 83 | export default FilterBar;
|
0 commit comments