Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

setURL.tsx 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. 'use client'
  2. import React from 'react'
  3. import Button from '@/app/components/base/button'
  4. import { useTranslation } from 'react-i18next'
  5. type SetURLProps = {
  6. repoUrl: string
  7. onChange: (value: string) => void
  8. onNext: () => void
  9. onCancel: () => void
  10. }
  11. const SetURL: React.FC<SetURLProps> = ({ repoUrl, onChange, onNext, onCancel }) => {
  12. const { t } = useTranslation()
  13. return (
  14. <>
  15. <label
  16. htmlFor='repoUrl'
  17. className='flex flex-col justify-center items-start self-stretch text-text-secondary'
  18. >
  19. <span className='system-sm-semibold'>{t('plugin.installFromGitHub.gitHubRepo')}</span>
  20. </label>
  21. <input
  22. type='url'
  23. id='repoUrl'
  24. name='repoUrl'
  25. value={repoUrl}
  26. onChange={e => onChange(e.target.value)}
  27. className='flex items-center self-stretch rounded-lg border border-components-input-border-active
  28. bg-components-input-bg-active shadows-shadow-xs p-2 gap-[2px] flex-grow overflow-hidden
  29. text-components-input-text-filled text-ellipsis system-sm-regular'
  30. placeholder='Please enter GitHub repo URL'
  31. />
  32. <div className='flex justify-end items-center gap-2 self-stretch mt-4'>
  33. <Button
  34. variant='secondary'
  35. className='min-w-[72px]'
  36. onClick={onCancel}
  37. >
  38. {t('plugin.installModal.cancel')}
  39. </Button>
  40. <Button
  41. variant='primary'
  42. className='min-w-[72px]'
  43. onClick={onNext}
  44. disabled={!repoUrl.trim()}
  45. >
  46. {t('plugin.installModal.next')}
  47. </Button>
  48. </div>
  49. </>
  50. )
  51. }
  52. export default SetURL