marketplace-item.tsx 802 B

12345678910111213141516171819202122232425262728293031323334353637
  1. 'use client'
  2. import type { FC } from 'react'
  3. import React from 'react'
  4. import type { Plugin } from '../../../types'
  5. import Loading from '../../base/loading'
  6. import LoadedItem from './loaded-item'
  7. import type { VersionProps } from '@/app/components/plugins/types'
  8. type Props = {
  9. checked: boolean
  10. onCheckedChange: (plugin: Plugin) => void
  11. payload?: Plugin
  12. version: string
  13. versionInfo: VersionProps
  14. }
  15. const MarketPlaceItem: FC<Props> = ({
  16. checked,
  17. onCheckedChange,
  18. payload,
  19. version,
  20. versionInfo,
  21. }) => {
  22. if (!payload) return <Loading />
  23. return (
  24. <LoadedItem
  25. checked={checked}
  26. onCheckedChange={onCheckedChange}
  27. payload={{ ...payload, version }}
  28. isFromMarketPlace
  29. versionInfo={versionInfo}
  30. />
  31. )
  32. }
  33. export default React.memo(MarketPlaceItem)