36 lines
891 B
TypeScript
Raw Permalink Normal View History

2025-06-27 16:43:56 +08:00
import { memo } from 'react'
2025-06-27 15:01:33 +08:00
import Card from './card'
2025-06-27 16:43:56 +08:00
import InstallFromMarketplace from './install-from-marketplace'
import { useGlobalPublicStore } from '@/context/global-public-context'
2025-07-17 11:17:49 +08:00
import { useGetDataSourceListAuth } from '@/service/use-datasource'
2025-06-27 15:01:33 +08:00
const DataSourcePage = () => {
2025-06-27 16:43:56 +08:00
const { enable_marketplace } = useGlobalPublicStore(s => s.systemFeatures)
2025-07-17 11:17:49 +08:00
const { data } = useGetDataSourceListAuth()
2025-06-27 15:01:33 +08:00
return (
2025-06-27 16:43:56 +08:00
<div>
<div className='space-y-2'>
2025-07-17 11:17:49 +08:00
{
data?.result.map(item => (
<Card
key={item.plugin_unique_identifier}
item={item}
/>
))
}
2025-06-27 16:43:56 +08:00
</div>
{
enable_marketplace && (
<InstallFromMarketplace
2025-07-23 16:59:47 +08:00
providers={data?.result || []}
2025-06-27 16:43:56 +08:00
searchText={''}
/>
)
}
2025-06-27 15:01:33 +08:00
</div>
)
}
2025-06-27 16:43:56 +08:00
export default memo(DataSourcePage)