diff --git a/src/client/dd-hub-react/src/sections/document/view/doc-search-view.tsx b/src/client/dd-hub-react/src/sections/document/view/doc-search-view.tsx index c105da6..8e9f38d 100644 --- a/src/client/dd-hub-react/src/sections/document/view/doc-search-view.tsx +++ b/src/client/dd-hub-react/src/sections/document/view/doc-search-view.tsx @@ -1,4 +1,4 @@ -import { useState, useCallback } from 'react'; +import { useState, useCallback, useEffect } from 'react'; import Box from '@mui/material/Box'; import Grid from '@mui/material/Grid'; @@ -7,6 +7,7 @@ import Typography from '@mui/material/Typography'; import Pagination from '@mui/material/Pagination'; import { DashboardContent } from 'src/layouts/dashboard'; +import { Filter, getFiltersAsync } from 'src/api/filter-service'; import { Iconify } from 'src/components/iconify'; @@ -25,10 +26,18 @@ type Props = { export function DocSearchView({ posts }: Props) { const [sortBy, setSortBy] = useState('latest'); + const [filters, setFilters] = useState() + const handleSort = useCallback((newSort: string) => { setSortBy(newSort); }, []); + useEffect(() => { + getFiltersAsync().then((res) => { + setFilters(res); + }); + }, []); + return (