chat-variable-button.tsx 861 B

123456789101112131415161718192021222324
  1. import { memo } from 'react'
  2. import Button from '@/app/components/base/button'
  3. import { BubbleX } from '@/app/components/base/icons/src/vender/line/others'
  4. import { useStore } from '@/app/components/workflow/store'
  5. const ChatVariableButton = ({ disabled }: { disabled: boolean }) => {
  6. const setShowChatVariablePanel = useStore(s => s.setShowChatVariablePanel)
  7. const setShowEnvPanel = useStore(s => s.setShowEnvPanel)
  8. const setShowDebugAndPreviewPanel = useStore(s => s.setShowDebugAndPreviewPanel)
  9. const handleClick = () => {
  10. setShowChatVariablePanel(true)
  11. setShowEnvPanel(false)
  12. setShowDebugAndPreviewPanel(false)
  13. }
  14. return (
  15. <Button className='p-2' disabled={disabled} onClick={handleClick}>
  16. <BubbleX className='w-4 h-4 text-components-button-secondary-text' />
  17. </Button>
  18. )
  19. }
  20. export default memo(ChatVariableButton)