index.tsx 939 B

12345678910111213141516171819202122232425262728
  1. import Button from '../button'
  2. import { RiInstallLine, RiLoader2Line } from '@remixicon/react'
  3. type InstallButtonProps = {
  4. loading: boolean
  5. onInstall: (e: React.MouseEvent) => void
  6. t: any
  7. }
  8. const InstallButton = ({ loading, onInstall, t }: InstallButtonProps) => {
  9. return (
  10. <Button size='small' className='z-[100]' onClick={onInstall}>
  11. <div className={`flex px-[3px] justify-center items-center gap-1
  12. ${loading ? 'text-components-button-secondary-text-disabled' : 'text-components-button-secondary-text'}
  13. system-xs-medium`}
  14. >
  15. {loading ? t('workflow.nodes.agent.pluginInstaller.installing') : t('workflow.nodes.agent.pluginInstaller.install')}
  16. </div>
  17. {loading
  18. ? <RiLoader2Line className='w-3.5 h-3.5 text-text-quaternary animate-spin' />
  19. : <RiInstallLine className='w-3.5 h-3.5 text-text-secondary' />
  20. }
  21. </Button>
  22. )
  23. }
  24. export default InstallButton