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2B,OAAQ,+BACRC,UAAWC,CACb,EACA,CACE3B,MAAO,OACPwB,MAAO1B,EAAE,IAAO,GAChB2B,OAAQ,wBACRC,UAAWC,CACb,EACD,CACD,CAAC7B,EAAE,C,EAIX,C","sources":["webpack://@affine/web/../core/src/components/pure/workspace-mode-filter-tab/index.css.ts","webpack://@affine/web/../core/src/components/pure/workspace-mode-filter-tab/index.tsx"],"sourcesContent":["import \"../core/src/components/pure/workspace-mode-filter-tab/index.css.ts.vanilla.css!=!../../../../../../../node_modules/@vanilla-extract/webpack-plugin/virtualFileLoader/dist/vanilla-extract-webpack-plugin-virtualFileLoader.cjs.js?{\\\"fileName\\\":\\\"../core/src/components/pure/workspace-mode-filter-tab/index.css.ts.vanilla.css\\\",\\\"source\\\":\\\"Ll8xaHNvYnQxMCB7CiAgZm9udC1zaXplOiB2YXIoLS1hZmZpbmUtZm9udC14cyk7CiAgZm9udC13ZWlnaHQ6IDYwMDsKICB0ZXh0LXRyYW5zZm9ybTogY2FwaXRhbGl6ZTsKfQ==\\\"}!../../../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var filterTab = '_1hsobt10';","import { RadioGroup, type RadioItem } from '@affine/component';\nimport type { AllPageFilterOption } from '@affine/core/atoms';\nimport { allPageFilterSelectAtom } from '@affine/core/atoms';\nimport { useNavigateHelper } from '@affine/core/hooks/use-navigate-helper';\nimport { WorkspaceSubPath } from '@affine/core/shared';\nimport { useI18n } from '@affine/i18n';\nimport { useService, WorkspaceService } from '@toeverything/infra';\nimport { useAtom } from 'jotai';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport * as styles from './index.css';\n\nexport const WorkspaceModeFilterTab = ({\n activeFilter,\n}: {\n activeFilter: AllPageFilterOption;\n}) => {\n const workspace = useService(WorkspaceService).workspace;\n const t = useI18n();\n const [value, setValue] = useState(activeFilter);\n const [filterMode, setFilterMode] = useAtom(allPageFilterSelectAtom);\n const { jumpToCollections, jumpToTags, jumpToSubPath } = useNavigateHelper();\n const handleValueChange = useCallback(\n (value: AllPageFilterOption) => {\n switch (value) {\n case 'collections':\n jumpToCollections(workspace.id);\n break;\n case 'tags':\n jumpToTags(workspace.id);\n break;\n case 'docs':\n jumpToSubPath(workspace.id, WorkspaceSubPath.ALL);\n break;\n }\n },\n [jumpToCollections, jumpToSubPath, jumpToTags, workspace]\n );\n\n useEffect(() => {\n if (value !== activeFilter) {\n setValue(activeFilter);\n setFilterMode(activeFilter);\n }\n }, [activeFilter, filterMode, setFilterMode, value]);\n\n return (\n (\n () => [\n {\n value: 'docs',\n label: t['com.arms.docs.header'](),\n testId: 'workspace-docs-button',\n className: styles.filterTab,\n },\n {\n value: 'collections',\n label: t['com.arms.collections.header'](),\n testId: 'workspace-collections-button',\n className: styles.filterTab,\n },\n {\n value: 'tags',\n label: t['Tags'](),\n testId: 'workspace-tags-button',\n className: styles.filterTab,\n },\n ],\n [t]\n )}\n />\n );\n};\n"],"names":["filterTab","WorkspaceModeFilterTab","activeFilter","workspace","useService","WorkspaceService","t","useI18n","value","setValue","useState","filterMode","setFilterMode","useAtom","allPageFilterSelectAtom","jumpToCollections","jumpToTags","jumpToSubPath","useNavigateHelper","handleValueChange","useCallback","id","WorkspaceSubPath","ALL","useEffect","RadioGroup","style","maxWidth","width","onChange","items","useMemo","label","testId","className","styles"],"sourceRoot":""}