Files
test1/components/nova-sdk/message-list/message-item/user-interaction/BrowserTakeoverInteraction.tsx
2026-03-20 07:33:46 +00:00

31 lines
770 B
TypeScript

import { memo, useState } from 'react'
import { InteractionButtons } from './InteractionButtons'
const TAKEOVER_ACTIONS = ['尝试接管', '立即跳过'] as const
interface BrowserTakeoverInteractionProps {
disabled?: boolean
browser_type?: string
onSendMessage?: (content: string) => void
}
export const BrowserTakeoverInteraction = memo(
({ disabled, onSendMessage }: BrowserTakeoverInteractionProps) => {
const [isClicked, setIsClicked] = useState(false)
const handleClick = (action: string) => {
setIsClicked(true)
onSendMessage?.(action)
}
return (
<InteractionButtons
items={[...TAKEOVER_ACTIONS]}
disabled={disabled}
isClicked={isClicked}
onClick={handleClick}
/>
)
},
)