Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

large-data-alert.tsx 1.2KB

123456789101112131415161718192021222324252627282930313233
  1. 'use client'
  2. import { RiInformation2Fill } from '@remixicon/react'
  3. import type { FC } from 'react'
  4. import React from 'react'
  5. import cn from '@/utils/classnames'
  6. import { useTranslation } from 'react-i18next'
  7. type Props = {
  8. textHasNoExport?: boolean
  9. downloadUrl?: string
  10. className?: string
  11. }
  12. const LargeDataAlert: FC<Props> = ({
  13. textHasNoExport,
  14. downloadUrl,
  15. className,
  16. }) => {
  17. const { t } = useTranslation()
  18. const text = textHasNoExport ? t('workflow.debug.variableInspect.largeDataNoExport') : t('workflow.debug.variableInspect.largeData')
  19. return (
  20. <div className={cn('flex h-8 items-center justify-between rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-bg-blur px-2 shadow-xs', className)}>
  21. <div className='flex h-full w-0 grow items-center space-x-1'>
  22. <RiInformation2Fill className='size-4 shrink-0 text-text-accent' />
  23. <div className='system-xs-regular w-0 grow truncate text-text-primary'>{text}</div>
  24. </div>
  25. {downloadUrl && (
  26. <div className='system-xs-medium-uppercase ml-1 shrink-0 cursor-pointer text-text-accent'>{t('workflow.debug.variableInspect.export')}</div>
  27. )}
  28. </div>
  29. )
  30. }
  31. export default React.memo(LargeDataAlert)