初始化模版工程

This commit is contained in:
Cloud Bot
2026-03-20 07:33:46 +00:00
commit 23717e0ecd
386 changed files with 51675 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
import { memo, useState } from 'react'
import type { UserInteraction } from '../../../types'
import { InteractionButtons } from './InteractionButtons'
interface ChoiceInteractionProps {
choice_options?: UserInteraction['choice_options']
disabled?: boolean
onSendMessage?: (content: string) => void
}
export const ChoiceInteraction = memo(
({ choice_options, disabled, onSendMessage }: ChoiceInteractionProps) => {
const [isClicked, setIsClicked] = useState(false)
const handleClick = (label: string) => {
setIsClicked(true)
onSendMessage?.(label)
}
if (!choice_options?.length) return null
return (
<InteractionButtons
items={choice_options}
disabled={disabled}
isClicked={isClicked}
onClick={handleClick}
/>
)
},
)