feat: parent child retrieval (#12106)

Signed-off-by: -LAN- <laipz8200@outlook.com>
Co-authored-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
Wu Tianwei
2024-12-26 12:01:51 +08:00
committed by GitHub
parent efdd54a670
commit 49feff082f
196 changed files with 9035 additions and 3115 deletions

View File

@@ -1,15 +1,15 @@
import React, { useEffect } from 'react'
import { useShallow } from 'zustand/react/shallow'
import { RiLayoutRight2Line } from '@remixicon/react'
import { LayoutRight2LineMod } from '../base/icons/src/public/knowledge'
import NavLink from './navLink'
import type { NavIcon } from './navLink'
import AppBasic from './basic'
import AppInfo from './app-info'
import DatasetInfo from './dataset-info'
import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints'
import {
AlignLeft01,
AlignRight01,
} from '@/app/components/base/icons/src/vender/line/layout'
import { useStore as useAppStore } from '@/app/components/app/store'
import cn from '@/utils/classnames'
export type IAppDetailNavProps = {
iconType?: 'app' | 'dataset' | 'notion'
@@ -63,7 +63,16 @@ const AppDetailNav = ({ title, desc, isExternal, icon, icon_background, navigati
{iconType === 'app' && (
<AppInfo expand={expand} />
)}
{iconType !== 'app' && (
{iconType === 'dataset' && (
<DatasetInfo
name={title}
description={desc}
isExternal={isExternal}
expand={expand}
extraInfo={extraInfo && extraInfo(appSidebarExpand)}
/>
)}
{!['app', 'dataset'].includes(iconType) && (
<AppBasic
mode={appSidebarExpand}
iconType={iconType}
@@ -75,9 +84,9 @@ const AppDetailNav = ({ title, desc, isExternal, icon, icon_background, navigati
/>
)}
</div>
{!expand && (
<div className='mt-1 mx-auto w-6 h-[1px] bg-divider-subtle' />
)}
<div className='px-4'>
<div className={cn('mt-1 mx-auto h-[1px] bg-divider-subtle', !expand && 'w-6')} />
</div>
<nav
className={`
grow space-y-1
@@ -89,7 +98,6 @@ const AppDetailNav = ({ title, desc, isExternal, icon, icon_background, navigati
<NavLink key={index} mode={appSidebarExpand} iconMap={{ selected: item.selectedIcon, normal: item.icon }} name={item.name} href={item.href} />
)
})}
{extraInfo && extraInfo(appSidebarExpand)}
</nav>
{
!isMobile && (
@@ -105,8 +113,8 @@ const AppDetailNav = ({ title, desc, isExternal, icon, icon_background, navigati
>
{
expand
? <AlignLeft01 className='w-[14px] h-[14px]' />
: <AlignRight01 className='w-[14px] h-[14px]' />
? <RiLayoutRight2Line className='w-5 h-5 text-components-menu-item-text' />
: <LayoutRight2LineMod className='w-5 h-5 text-components-menu-item-text' />
}
</div>
</div>