diff --git a/front_end/src/app/(main)/notebooks/[id]/[[...slug]]/page_compotent.tsx b/front_end/src/app/(main)/notebooks/[id]/[[...slug]]/page_compotent.tsx index 69785b1e98..09228553d4 100644 --- a/front_end/src/app/(main)/notebooks/[id]/[[...slug]]/page_compotent.tsx +++ b/front_end/src/app/(main)/notebooks/[id]/[[...slug]]/page_compotent.tsx @@ -19,15 +19,17 @@ import CommentFeed from "@/components/comment_feed"; import { PostDropdownMenu, SharePostMenu } from "@/components/post_actions"; import PostVoter from "@/components/post_card/basic_post_card/post_voter"; import PostSubscribeButton from "@/components/post_subscribe/subscribe_button"; +import Chip from "@/components/ui/chip"; import CircleDivider from "@/components/ui/circle_divider"; import { POST_CATEGORIES_FILTER } from "@/constants/posts_feed"; import { PostSubscriptionProvider } from "@/contexts/post_subscription_context"; import ServerPostsApi from "@/services/api/posts/posts.server"; import ServerProjectsApi from "@/services/api/projects/projects.server"; import { PostStatus } from "@/types/post"; -import { TournamentType } from "@/types/projects"; +import { TaxonomyProjectType, TournamentType } from "@/types/projects"; import { formatDate } from "@/utils/formatters/date"; import { estimateReadingTime } from "@/utils/markdown"; +import { getProjectLink } from "@/utils/navigation"; import { getPostTitle, isNotebookPost } from "@/utils/questions/helpers"; const IndividualNotebookPage: FC<{ @@ -153,25 +155,39 @@ const IndividualNotebookPage: FC<{ contentId={NOTEBOOK_CONTENT_SECTION} />
- {!!postData.projects.category?.length && ( -
- {t("Categories") + ":"} - {postData.projects.category?.map((category, index) => ( - - {" "} - { + const allProjects = [ + ...(postData.projects.index ?? []), + ...(postData.projects.tournament ?? []), + ...(postData.projects.question_series ?? []), + ...(postData.projects.community ?? []), + ...(postData.projects.category ?? []), + ...(postData.projects.leaderboard_tag ?? []), + ]; + const getChipText = (name: string, type?: string) => + type === "leaderboard_tag" ? `🏆 ${name}` : name; + + return allProjects.length > 0 ? ( +
+ {allProjects.map((element) => ( + - {category.name} - - {index < (postData.projects.category?.length ?? 0) - 1 - ? "," - : "."} - - ))} -
- )} + {getChipText(element.name, element.type)} + + ))} +
+ ) : null; + })()}