feat: marketplace list
parent
f0f1bfa5d9
commit
0d85d44de5
@ -0,0 +1,48 @@
|
|||||||
|
'use client'
|
||||||
|
import type { MarketplaceCollection } from '../types'
|
||||||
|
import type { Plugin } from '@/app/components/plugins/types'
|
||||||
|
import Card from '@/app/components/plugins/card'
|
||||||
|
import CardMoreInfo from '@/app/components/plugins/card/card-more-info'
|
||||||
|
|
||||||
|
interface ListWithCollectionProps {
|
||||||
|
marketplaceCollections: MarketplaceCollection[]
|
||||||
|
marketplaceCollectionPluginsMap: Record<string, Plugin[]>
|
||||||
|
}
|
||||||
|
const ListWithCollection = ({
|
||||||
|
marketplaceCollections,
|
||||||
|
marketplaceCollectionPluginsMap,
|
||||||
|
}: ListWithCollectionProps) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{
|
||||||
|
marketplaceCollections.map(collection => (
|
||||||
|
<div
|
||||||
|
key={collection.name}
|
||||||
|
className='py-3'
|
||||||
|
>
|
||||||
|
<div className='title-xl-semi-bold text-text-primary'>{collection.name}</div>
|
||||||
|
<div className='system-xs-regular text-text-tertiary'>{collection.description}</div>
|
||||||
|
<div className='grid grid-cols-4 gap-3 mt-2'>
|
||||||
|
{
|
||||||
|
marketplaceCollectionPluginsMap[collection.name].map(plugin => (
|
||||||
|
<Card
|
||||||
|
key={plugin.name}
|
||||||
|
payload={plugin}
|
||||||
|
footer={
|
||||||
|
<CardMoreInfo
|
||||||
|
downloadCount={plugin.install_count}
|
||||||
|
tags={['Search', 'Productivity']}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ListWithCollection
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
'use client'
|
||||||
|
import type { Plugin } from '../../types'
|
||||||
|
import type { MarketplaceCollection } from '../types'
|
||||||
|
import List from './index'
|
||||||
|
|
||||||
|
interface ListWrapperProps {
|
||||||
|
marketplaceCollections: MarketplaceCollection[]
|
||||||
|
marketplaceCollectionPluginsMap: Record<string, Plugin[]>
|
||||||
|
}
|
||||||
|
const ListWrapper = ({
|
||||||
|
marketplaceCollections,
|
||||||
|
marketplaceCollectionPluginsMap,
|
||||||
|
}: ListWrapperProps) => {
|
||||||
|
return (
|
||||||
|
<List
|
||||||
|
marketplaceCollections={marketplaceCollections}
|
||||||
|
marketplaceCollectionPluginsMap={marketplaceCollectionPluginsMap}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ListWrapper
|
||||||
Loading…
Reference in New Issue