version.tsx 1009 B

12345678910111213141516171819202122232425262728293031323334
  1. 'use client'
  2. import type { FC } from 'react'
  3. import React from 'react'
  4. import Badge, { BadgeState } from '@/app/components/base/badge/index'
  5. import type { VersionProps } from '../../types'
  6. const Version: FC<VersionProps> = ({
  7. hasInstalled,
  8. installedVersion,
  9. toInstallVersion,
  10. }) => {
  11. return (
  12. <>
  13. {
  14. !hasInstalled
  15. ? (
  16. <Badge className='mx-1' size="s" state={BadgeState.Default}>{toInstallVersion}</Badge>
  17. )
  18. : (
  19. <>
  20. <Badge className='mx-1' size="s" state={BadgeState.Warning}>
  21. {`${installedVersion} -> ${toInstallVersion}`}
  22. </Badge>
  23. {/* <div className='flex px-0.5 justify-center items-center gap-0.5'>
  24. <div className='text-text-warning system-xs-medium'>Used in 3 apps</div>
  25. <RiInformation2Line className='w-4 h-4 text-text-tertiary' />
  26. </div> */}
  27. </>
  28. )
  29. }
  30. </>
  31. )
  32. }
  33. export default React.memo(Version)