mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-06-01 16:03:38 +08:00
parent
a147d2a200
commit
3c09b57059
@ -6,7 +6,7 @@ import {
|
|||||||
RiArrowDownSLine,
|
RiArrowDownSLine,
|
||||||
RiArrowRightSLine,
|
RiArrowRightSLine,
|
||||||
} from '@remixicon/react'
|
} from '@remixicon/react'
|
||||||
import { Menu, MenuButton, MenuItems, Transition } from '@headlessui/react'
|
import { Menu, MenuButton, MenuItem, MenuItems, Transition } from '@headlessui/react'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
import { debounce } from 'lodash-es'
|
import { debounce } from 'lodash-es'
|
||||||
import cn from '@/utils/classnames'
|
import cn from '@/utils/classnames'
|
||||||
@ -77,7 +77,7 @@ const NavSelector = ({ curNav, navs, createText, isApp, onCreate, onLoadmore }:
|
|||||||
<div className="overflow-auto px-1 py-1" style={{ maxHeight: '50vh' }} onScroll={handleScroll}>
|
<div className="overflow-auto px-1 py-1" style={{ maxHeight: '50vh' }} onScroll={handleScroll}>
|
||||||
{
|
{
|
||||||
navs.map(nav => (
|
navs.map(nav => (
|
||||||
<MenuItems key={nav.id}>
|
<MenuItem key={nav.id}>
|
||||||
<div className='flex w-full cursor-pointer items-center truncate rounded-lg px-3 py-[6px] text-[14px] font-normal text-gray-700 hover:bg-gray-100' onClick={() => {
|
<div className='flex w-full cursor-pointer items-center truncate rounded-lg px-3 py-[6px] text-[14px] font-normal text-gray-700 hover:bg-gray-100' onClick={() => {
|
||||||
if (curNav?.id === nav.id)
|
if (curNav?.id === nav.id)
|
||||||
return
|
return
|
||||||
@ -112,12 +112,12 @@ const NavSelector = ({ curNav, navs, createText, isApp, onCreate, onLoadmore }:
|
|||||||
{nav.name}
|
{nav.name}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</MenuItems>
|
</MenuItem>
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
{!isApp && isCurrentWorkspaceEditor && (
|
{!isApp && isCurrentWorkspaceEditor && (
|
||||||
<MenuButton className='w-full p-1'>
|
<MenuItem as="div" className='w-full p-1'>
|
||||||
<div onClick={() => onCreate('')} className={cn(
|
<div onClick={() => onCreate('')} className={cn(
|
||||||
'flex cursor-pointer items-center gap-2 rounded-lg px-3 py-[6px] hover:bg-gray-100',
|
'flex cursor-pointer items-center gap-2 rounded-lg px-3 py-[6px] hover:bg-gray-100',
|
||||||
)}>
|
)}>
|
||||||
@ -126,7 +126,7 @@ const NavSelector = ({ curNav, navs, createText, isApp, onCreate, onLoadmore }:
|
|||||||
</div>
|
</div>
|
||||||
<div className='grow text-left text-[14px] font-normal text-gray-700'>{createText}</div>
|
<div className='grow text-left text-[14px] font-normal text-gray-700'>{createText}</div>
|
||||||
</div>
|
</div>
|
||||||
</MenuButton>
|
</MenuItem>
|
||||||
)}
|
)}
|
||||||
{isApp && isCurrentWorkspaceEditor && (
|
{isApp && isCurrentWorkspaceEditor && (
|
||||||
<Menu as="div" className="relative h-full w-full">
|
<Menu as="div" className="relative h-full w-full">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user