mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-28 21:42:27 +08:00
feat(session): add session modal component to session item
Implement session modal for editing session details, using existing disclosure hooks
This commit is contained in:
parent
874d74cf6e
commit
798126d39c
@ -1,5 +1,6 @@
|
||||
import { Button, cn, useDisclosure } from '@heroui/react'
|
||||
import { DeleteIcon, EditIcon } from '@renderer/components/Icons'
|
||||
import { SessionModal } from '@renderer/components/Popups/agent/SessionModal'
|
||||
import { useRuntime } from '@renderer/hooks/useRuntime'
|
||||
import { AgentSessionEntity } from '@renderer/types'
|
||||
import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger } from '@renderer/ui/context-menu'
|
||||
@ -18,8 +19,7 @@ interface SessionItemProps {
|
||||
|
||||
const SessionItem: FC<SessionItemProps> = ({ session, agentId, onDelete, onPress }) => {
|
||||
const { t } = useTranslation()
|
||||
// const { isOpen, onOpen, onClose } = useDisclosure()
|
||||
const { onOpen } = useDisclosure()
|
||||
const { isOpen, onOpen, onClose } = useDisclosure()
|
||||
const { chat } = useRuntime()
|
||||
const activeSessionId = chat.activeSessionId[agentId]
|
||||
|
||||
@ -70,7 +70,7 @@ const SessionItem: FC<SessionItemProps> = ({ session, agentId, onDelete, onPress
|
||||
</ContextMenuItem>
|
||||
</ContextMenuContent>
|
||||
</ContextMenu>
|
||||
{/* TODO: Add a session modal here */}
|
||||
<SessionModal agentId={agentId} isOpen={isOpen} onClose={onClose} session={session} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user