import { Button } from '@affine/component'; import { FilterList, SaveViewButton, useAllPageSetting, ViewList, } from '@affine/component/page-list'; import { config } from '@affine/env'; import type { WorkspaceHeaderProps } from '@affine/env/workspace'; import { WorkspaceFlavour, WorkspaceSubPath } from '@affine/env/workspace'; import { useAFFiNEI18N } from '@affine/i18n/hooks'; import { SettingsIcon } from '@blocksuite/icons'; import { RESET } from 'jotai/utils'; import type { ReactElement } from 'react'; import { NIL } from 'uuid'; import { BlockSuiteEditorHeader } from './blocksuite/workspace-header'; import { filterContainerStyle } from './filter-container.css'; import { WorkspaceModeFilterTab, WorkspaceTitle } from './pure/workspace-title'; export function WorkspaceHeader({ currentWorkspace, currentEntry, }: WorkspaceHeaderProps): ReactElement { const setting = useAllPageSetting(); const t = useAFFiNEI18N(); if ('subPath' in currentEntry) { if (currentEntry.subPath === WorkspaceSubPath.ALL) { const leftSlot = ; const filterContainer = setting.currentView.filterList.length > 0 && (
{ setting.setCurrentView(view => ({ ...view, filterList, })); }} />
{config.enableAllPageFilter && (
{setting.currentView.id !== NIL || (setting.currentView.id === NIL && setting.currentView.filterList.length > 0) ? ( ) : ( )}
)}
); return ( <> {filterContainer} ); } else if (currentEntry.subPath === WorkspaceSubPath.SETTING) { return ( } > {t['Workspace Settings']()} ); } else if (currentEntry.subPath === WorkspaceSubPath.SHARED) { return ( ); } else if (currentEntry.subPath === WorkspaceSubPath.TRASH) { return ( ); } } else if ('pageId' in currentEntry) { const pageId = currentEntry.pageId; const isPublic = currentWorkspace.flavour === WorkspaceFlavour.PUBLIC; return ( ); } return <>; }