Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

index.tsx 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import {
  2. memo,
  3. } from 'react'
  4. import { RiCloseLine } from '@remixicon/react'
  5. import type { GlobalVariable } from '../../types'
  6. import Item from './item'
  7. import { useStore } from '@/app/components/workflow/store'
  8. import cn from '@/utils/classnames'
  9. const Panel = () => {
  10. const setShowPanel = useStore(s => s.setShowGlobalVariablePanel)
  11. const globalVariableList: GlobalVariable[] = [
  12. {
  13. name: 'conversation_id',
  14. value_type: 'string',
  15. description: 'conversation id',
  16. },
  17. ]
  18. return (
  19. <div
  20. className={cn(
  21. 'relative flex h-full w-[420px] flex-col rounded-l-2xl border border-components-panel-border bg-components-panel-bg-alt',
  22. )}
  23. >
  24. <div className='system-xl-semibold flex shrink-0 items-center justify-between p-4 pb-0 text-text-primary'>
  25. Global Variables(Current not show)
  26. <div className='flex items-center'>
  27. <div
  28. className='flex h-6 w-6 cursor-pointer items-center justify-center'
  29. onClick={() => setShowPanel(false)}
  30. >
  31. <RiCloseLine className='h-4 w-4 text-text-tertiary' />
  32. </div>
  33. </div>
  34. </div>
  35. <div className='system-sm-regular shrink-0 px-4 py-1 text-text-tertiary'>...</div>
  36. <div className='grow overflow-y-auto rounded-b-2xl px-4'>
  37. {globalVariableList.map(item => (
  38. <Item
  39. key={item.name}
  40. payload={item}
  41. />
  42. ))}
  43. </div>
  44. </div>
  45. )
  46. }
  47. export default memo(Panel)