import { useTopNavStore } from '@/ui/stores/top-nav' import { BreadcrumbNav } from './breadcrumb-nav' import { ShumaiLogo } from '@/ui/components/ui/icons' import { useUiStore } from '@/ui/stores/ui' export function TopNav() { const { projectState } = useTopNavStore() const uiStore = useUiStore() if (!projectState) { return } const { teamId, projectId, projectName, ancestorFolders, currentAsset, isRootFolder, fileId, versions, isPublic, shareId, onFolderClick, } = projectState const isFileView = !!fileId const isShareConfig = !!shareId && !isFileView const isLeftSidebarCollapsed = isFileView ? uiStore.fileViewLeftSidebarCollapsed : isShareConfig ? uiStore.shareConfigLeftSidebarCollapsed : uiStore.fileListLeftSidebarCollapsed const onLeftSidebarToggle = isPublic ? undefined : () => isFileView ? uiStore.setFileViewLeftSidebarCollapsed(!uiStore.fileViewLeftSidebarCollapsed) : isShareConfig ? uiStore.setShareConfigLeftSidebarCollapsed(!uiStore.shareConfigLeftSidebarCollapsed) : uiStore.setFileListLeftSidebarCollapsed(!uiStore.fileListLeftSidebarCollapsed) const isRightSidebarCollapsed = isPublic && projectState.isRightSidebarCollapsed !== undefined ? projectState.isRightSidebarCollapsed : isFileView ? uiStore.fileViewRightSidebarCollapsed : isShareConfig ? uiStore.shareConfigRightSidebarCollapsed : uiStore.fileListRightSidebarCollapsed const onRightSidebarToggle = isPublic && projectState.onRightSidebarToggle ? projectState.onRightSidebarToggle : () => isFileView ? uiStore.setFileViewRightSidebarCollapsed(!uiStore.fileViewRightSidebarCollapsed) : isShareConfig ? uiStore.setShareConfigRightSidebarCollapsed( !uiStore.shareConfigRightSidebarCollapsed, ) : uiStore.setFileListRightSidebarCollapsed(!uiStore.fileListRightSidebarCollapsed) const displayStyle = projectId ? (uiStore.viewModes[projectId] ?? 'card') : 'card' const onDisplayStyleChange = isPublic ? undefined : (style: 'card' | 'list') => { if (projectId) uiStore.setViewMode(projectId, style) } return ( ) } function TeamHeader() { return (
) }