refactor(doc-search-view): Gitter zu Filtern hinzufügen

This commit is contained in:
2025-07-07 13:51:02 +02:00
parent 593f4deb3e
commit f340130f89

View File

@@ -1,10 +1,8 @@
import React from 'react';
import { useState, useCallback, useEffect } from 'react'; import { useState, useCallback, useEffect } from 'react';
import Box from '@mui/material/Box'; import Box from '@mui/material/Box';
import Grid from '@mui/material/Grid'; import Grid from '@mui/material/Grid';
import Button from '@mui/material/Button'; import Button from '@mui/material/Button';
import TextField from '@mui/material/TextField';
import Typography from '@mui/material/Typography'; import Typography from '@mui/material/Typography';
import Pagination from '@mui/material/Pagination'; import Pagination from '@mui/material/Pagination';
@@ -85,8 +83,9 @@ export function DocSearchView({ posts }: Props) {
</Button> </Button>
</Box> </Box>
<> <Grid container spacing={3}>
{filters.map((filter, index) => { {filters.map((filter, index) => {
let filterComp; let filterComp;
switch (filter.type) { switch (filter.type) {
case 'BOOLEAN': case 'BOOLEAN':
@@ -113,7 +112,16 @@ export function DocSearchView({ posts }: Props) {
default: default:
console.error(`Unknown filter type: ${filter.type}`); console.error(`Unknown filter type: ${filter.type}`);
} }
return ( return (
<Grid
key={filter.id}
size={{
xs: 12,
sm: 6,
md: 3,
}}
>
<Box <Box
sx={{ sx={{
mb: 5, mb: 5,
@@ -124,10 +132,11 @@ export function DocSearchView({ posts }: Props) {
> >
{filterComp} {filterComp}
</Box> </Box>
) </Grid>
);
} }
)} )}
</> </Grid>
<Grid container spacing={3}> <Grid container spacing={3}>
{posts.map((post, index) => { {posts.map((post, index) => {