node-status-icon.tsx 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import {
  2. RiAlertFill,
  3. RiCheckboxCircleFill,
  4. RiErrorWarningLine,
  5. RiLoader2Line,
  6. } from '@remixicon/react'
  7. import cn from '@/utils/classnames'
  8. type NodeStatusIconProps = {
  9. status: string
  10. className?: string
  11. }
  12. const NodeStatusIcon = ({
  13. status,
  14. className,
  15. }: NodeStatusIconProps) => {
  16. return (
  17. <>
  18. {
  19. status === 'succeeded' && (
  20. <RiCheckboxCircleFill className={cn('h-4 w-4 shrink-0 text-text-success', className)} />
  21. )
  22. }
  23. {
  24. status === 'failed' && (
  25. <RiErrorWarningLine className={cn('h-4 w-4 shrink-0 text-text-warning', className)} />
  26. )
  27. }
  28. {
  29. (status === 'stopped' || status === 'exception') && (
  30. <RiAlertFill className={cn('h-4 w-4 shrink-0 text-text-warning-secondary', className)} />
  31. )
  32. }
  33. {
  34. status === 'running' && (
  35. <RiLoader2Line className={cn('h-4 w-4 shrink-0 animate-spin text-text-accent', className)} />
  36. )
  37. }
  38. </>
  39. )
  40. }
  41. export default NodeStatusIcon