Skip to content

Commit

Permalink
Update literature type list
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaschlegel committed Nov 11, 2024
1 parent f33da6a commit 0f502d6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/LiteratureListLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const LiteratureListLayout = ({ initialLiteratureData }: LiteratureListLayoutPro
const filteredLiteratureData = useMemo(() => {
return initialLiteratureData.filter((item) => {
const isVisible = !item.hidden // Ensure hidden items are excluded
const matchesType = selectedType === '' || item.type === selectedType
const matchesType = selectedType === '' || item.literatureType === selectedType
const matchesSearch =
item.title.toLowerCase().includes(searchQuery.toLowerCase()) ||
item.authors.some((author) =>
Expand All @@ -64,7 +64,9 @@ const LiteratureListLayout = ({ initialLiteratureData }: LiteratureListLayoutPro
new Set(initialLiteratureData.filter((item) => !item.hidden).flatMap((item) => item.tags))
)

const availableTypes = Array.from(new Set(initialLiteratureData.map((item) => item.type)))
const availableTypes = Array.from(
new Set(initialLiteratureData.map((item) => item.literatureType))
)

return (
<div className="flex sm:space-x-24">
Expand Down

0 comments on commit 0f502d6

Please sign in to comment.