diff --git a/apps/desktop/layer/renderer/src/modules/entry/EntryTags.tsx b/apps/desktop/layer/renderer/src/modules/entry/EntryTags.tsx index c520f3208..4fc87f684 100644 --- a/apps/desktop/layer/renderer/src/modules/entry/EntryTags.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry/EntryTags.tsx @@ -1,10 +1,12 @@ import { Button } from "@follow/components/ui/button/index.js" import { ScrollArea } from "@follow/components/ui/scroll-area/ScrollArea.js" +import { SegmentGroup, SegmentItem } from "@follow/components/ui/segment/index.js" import { FeedViewType } from "@follow/constants" import type { EntryTagSummary } from "@follow/database/schemas/types" import { useEntryTagsQuery } from "@follow/store/entry/hooks" import { cn } from "@follow/utils" -import { useMemo } from "react" +import { useMemo, useState } from "react" +import { useTranslation } from "react-i18next" import { titleCase } from "title-case" import { useModalStack } from "~/components/ui/modal/stacked/hooks" @@ -31,8 +33,12 @@ const chipClassName: Record, string> = { type TagItem = { label: string; kind: TagKind } const TagEntriesModal = ({ tag, feedId }: { tag: TagItem; feedId?: string | null }) => { + const { t } = useTranslation() + const [scope, setScope] = useState<"current" | "all">("current") + const currentFeedId = scope === "current" ? feedId : undefined + const { data, isLoading, isFetching, refetch } = useEntryTagsQuery({ - feedId, + feedId: currentFeedId, tag: tag.kind === "category" ? { kind: "schemaOrgCategory", value: tag.label } @@ -44,8 +50,16 @@ const TagEntriesModal = ({ tag, feedId }: { tag: TagItem; feedId?: string | null return (
-
- Entries tagged with {normalizeLabel(tag.label)} +
+
+ Entries tagged with {normalizeLabel(tag.label)} +
+ {feedId && ( + setScope(v as "current" | "all")}> + + + + )}