index.tsx 721 B

12345678910111213141516171819202122232425262728293031323334
  1. 'use client'
  2. import type { FC } from 'react'
  3. import React from 'react'
  4. import type { UpdatePluginModalType } from '../types'
  5. import { PluginSource } from '../types'
  6. import UpdateFromGitHub from './from-github'
  7. import UpdateFromMarketplace from './from-market-place'
  8. const UpdatePlugin: FC<UpdatePluginModalType> = ({
  9. type,
  10. marketPlace,
  11. github,
  12. onCancel,
  13. onSave,
  14. }) => {
  15. if (type === PluginSource.github) {
  16. return (
  17. <UpdateFromGitHub
  18. payload={github!}
  19. onSave={onSave}
  20. onCancel={onCancel}
  21. />
  22. )
  23. }
  24. return (
  25. <UpdateFromMarketplace
  26. payload={marketPlace!}
  27. onSave={onSave}
  28. onCancel={onCancel}
  29. />
  30. )
  31. }
  32. export default React.memo(UpdatePlugin)