diff --git a/frontend/components/navigation/sidebar/sidebar-item-with-icon.tsx b/frontend/components/navigation/sidebar/sidebar-item-with-icon.tsx index ab7d614c..114c95fb 100644 --- a/frontend/components/navigation/sidebar/sidebar-item-with-icon.tsx +++ b/frontend/components/navigation/sidebar/sidebar-item-with-icon.tsx @@ -1,13 +1,19 @@ import { LucideIcon } from "lucide-react"; +import { useRouter } from "next/navigation"; interface SidebarItemWithIconProps { Icon: LucideIcon; label: string; + categoryId: number; } -const SidebarItemWithIcon = ({ Icon, label }: SidebarItemWithIconProps) => { +const SidebarItemWithIcon = ({ Icon, label, categoryId }: SidebarItemWithIconProps) => { + const router = useRouter(); + + const onClickCategory = () => router.push(`/categories/${categoryId}`); + return ( -
+
{ + const { data: categories, isSuccess: isCategoriesSuccess } = useQuery(getCategories()); + return (

Other topics

- {otherTopics.map((category) => { - const categoryLabel = categoriesToDisplayName[category]; - const categoryIcon = categoriesToIconsMap[category]; + { + categories?.map((category) => { + const categoryIcon = getIconFor(category.name); return ( - ); + ) })}