Refactor DocSearchView layout and update button text

- Added a new <Box> component to wrap <DocSearch> and <DocSort> for improved styling.
- Changed button text from "New post" to "New filter".
- Removed the old <Box> structure and integrated its contents into the new layout.
This commit is contained in:
2025-07-04 10:11:23 +02:00
parent b107273db3
commit 05c7b49bbc

View File

@@ -40,6 +40,14 @@ export function DocSearchView({ posts }: Props) {
}, []); }, []);
//#region example components //#region example components
// <Box
// sx={{
// mb: 5,
// display: 'flex',
// alignItems: 'center',
// justifyContent: 'space-between',
// }}
// >
// <DocSearch posts={posts} /> // <DocSearch posts={posts} />
// <DocSort // <DocSort
// sortBy={sortBy} // sortBy={sortBy}
@@ -50,6 +58,7 @@ export function DocSearchView({ posts }: Props) {
// { value: 'oldest', label: 'Oldest' }, // { value: 'oldest', label: 'Oldest' },
// ]} // ]}
// /> // />
// </Box>
//#endregion //#endregion
return ( return (
@@ -70,30 +79,10 @@ export function DocSearchView({ posts }: Props) {
color="inherit" color="inherit"
startIcon={<Iconify icon="mingcute:add-line" />} startIcon={<Iconify icon="mingcute:add-line" />}
> >
New post New filter
</Button> </Button>
</Box> </Box>
<Box
sx={{
mb: 5,
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
}}
>
<DocSearch posts={posts} />
<DocSort
sortBy={sortBy}
onSort={handleSort}
options={[
{ value: 'latest', label: 'Latest' },
{ value: 'popular', label: 'Popular' },
{ value: 'oldest', label: 'Oldest' },
]}
/>
</Box>
<> <>
{filters.map((filter, index) => {filters.map((filter, index) =>
( (