item.tsx 1.1 KB

123456789101112131415161718192021222324252627282930
  1. import { memo } from 'react'
  2. import { capitalize } from 'lodash-es'
  3. import { Env } from '@/app/components/base/icons/src/vender/line/others'
  4. import type { GlobalVariable } from '@/app/components/workflow/types'
  5. import cn from '@/utils/classnames'
  6. type Props = {
  7. payload: GlobalVariable
  8. }
  9. const Item = ({
  10. payload,
  11. }: Props) => {
  12. return (
  13. <div className={cn(
  14. 'mb-1 px-2.5 py-2 bg-components-panel-on-panel-item-bg radius-md border border-components-panel-border-subtle shadow-xs hover:bg-components-panel-on-panel-item-bg-hover',
  15. )}>
  16. <div className='flex items-center justify-between'>
  17. <div className='grow flex gap-1 items-center'>
  18. <Env className='w-4 h-4 text-util-colors-violet-violet-600' />
  19. <div className='text-text-primary system-sm-medium'>{payload.name}</div>
  20. <div className='text-text-tertiary system-xs-medium'>{capitalize(payload.value_type)}</div>
  21. </div>
  22. </div>
  23. <div className='text-text-tertiary system-xs-regular truncate'>{payload.description}</div>
  24. </div>
  25. )
  26. }
  27. export default memo(Item)