global-variable-button.tsx 649 B

1234567891011121314151617181920
  1. import { memo } from 'react'
  2. import Button from '@/app/components/base/button'
  3. import { GlobalVariable } from '@/app/components/base/icons/src/vender/line/others'
  4. import { useStore } from '@/app/components/workflow/store'
  5. const GlobalVariableButton = ({ disabled }: { disabled: boolean }) => {
  6. const setShowPanel = useStore(s => s.setShowGlobalVariablePanel)
  7. const handleClick = () => {
  8. setShowPanel(true)
  9. }
  10. return (
  11. <Button className='p-2' disabled={disabled} onClick={handleClick}>
  12. <GlobalVariable className='w-4 h-4 text-components-button-secondary-text' />
  13. </Button>
  14. )
  15. }
  16. export default memo(GlobalVariableButton)