mirror of
https://github.com/langgenius/dify.git
synced 2026-05-03 17:08:03 +08:00
Made-with: Cursor # Conflicts: # api/tests/unit_tests/controllers/console/app/test_message.py # api/tests/unit_tests/controllers/console/app/test_statistic.py # api/tests/unit_tests/controllers/console/app/test_workflow_draft_variable.py # api/tests/unit_tests/controllers/console/auth/test_data_source_bearer_auth.py # api/tests/unit_tests/controllers/console/auth/test_data_source_oauth.py # api/tests/unit_tests/controllers/console/auth/test_oauth_server.py # web/app/components/header/account-setting/data-source-page/data-source-notion/operate/index.tsx # web/app/components/header/account-setting/data-source-page/data-source-website/config-firecrawl-modal.tsx # web/app/components/header/account-setting/data-source-page/data-source-website/config-jina-reader-modal.tsx # web/app/components/header/account-setting/data-source-page/data-source-website/config-watercrawl-modal.tsx # web/app/components/header/account-setting/data-source-page/panel/config-item.tsx # web/app/components/header/account-setting/data-source-page/panel/index.tsx # web/app/components/workflow/nodes/knowledge-retrieval/node.tsx # web/package.json # web/pnpm-lock.yaml
62 lines
1.8 KiB
TypeScript
62 lines
1.8 KiB
TypeScript
import type { AgentLogItemWithChildren } from '@/types/workflow'
|
|
import { RiMoreLine } from '@remixicon/react'
|
|
import { useState } from 'react'
|
|
import Button from '@/app/components/base/button'
|
|
import {
|
|
PortalToFollowElem,
|
|
PortalToFollowElemContent,
|
|
PortalToFollowElemTrigger,
|
|
} from '@/app/components/base/portal-to-follow-elem'
|
|
|
|
type AgentLogNavMoreProps = {
|
|
options: AgentLogItemWithChildren[]
|
|
onShowAgentOrToolLog: (detail?: AgentLogItemWithChildren) => void
|
|
}
|
|
const AgentLogNavMore = ({
|
|
options,
|
|
onShowAgentOrToolLog,
|
|
}: AgentLogNavMoreProps) => {
|
|
const [open, setOpen] = useState(false)
|
|
|
|
return (
|
|
<PortalToFollowElem
|
|
placement="bottom-start"
|
|
offset={{
|
|
mainAxis: 2,
|
|
crossAxis: -54,
|
|
}}
|
|
open={open}
|
|
onOpenChange={setOpen}
|
|
>
|
|
<PortalToFollowElemTrigger onClick={() => setOpen(v => !v)}>
|
|
<Button
|
|
className="h-6 w-6"
|
|
variant="ghost-accent"
|
|
>
|
|
<RiMoreLine className="h-4 w-4" />
|
|
</Button>
|
|
</PortalToFollowElemTrigger>
|
|
<PortalToFollowElemContent>
|
|
<div className="w-[136px] rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur p-1 shadow-lg">
|
|
{
|
|
options.map(option => (
|
|
<div
|
|
key={option.message_id}
|
|
className="flex h-8 cursor-pointer items-center rounded-lg px-2 text-text-secondary system-md-regular hover:bg-state-base-hover"
|
|
onClick={() => {
|
|
onShowAgentOrToolLog(option)
|
|
setOpen(false)
|
|
}}
|
|
>
|
|
{option.label}
|
|
</div>
|
|
))
|
|
}
|
|
</div>
|
|
</PortalToFollowElemContent>
|
|
</PortalToFollowElem>
|
|
)
|
|
}
|
|
|
|
export default AgentLogNavMore
|