11import { Metadata } from 'next'
2- import { Suspense } from 'react'
32import AgentStoreClient from './store-client'
43import { getAgentsData } from './agents-data'
54
@@ -28,12 +27,7 @@ interface StorePageProps {
2827 searchParams : { [ key : string ] : string | string [ ] | undefined }
2928}
3029
31- // Server Component for fetching and rendering agents data
32- async function AgentsDataProvider ( {
33- searchParams,
34- } : {
35- searchParams : StorePageProps [ 'searchParams' ]
36- } ) {
30+ export default async function StorePage ( { searchParams } : StorePageProps ) {
3731 // Fetch agents data with ISR
3832 const agentsData = await getAgentsData ( )
3933
@@ -50,36 +44,3 @@ async function AgentsDataProvider({
5044 />
5145 )
5246}
53-
54- // Loading component for better UX
55- function AgentsLoading ( ) {
56- return (
57- < div className = "container mx-auto py-8 px-4" >
58- < div className = "max-w-7xl mx-auto" >
59- < div className = "mb-12" >
60- < h1 className = "text-4xl font-bold text-white mb-2" > Agent Store</ h1 >
61- < p className = "text-xl text-muted-foreground" >
62- Browse all published AI agents. Run, compose, or fork them.
63- </ p >
64- </ div >
65-
66- < div className = "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6" >
67- { Array . from ( { length : 6 } ) . map ( ( _ , i ) => (
68- < div
69- key = { i }
70- className = "h-[220px] bg-card/50 border rounded-lg animate-pulse"
71- />
72- ) ) }
73- </ div >
74- </ div >
75- </ div >
76- )
77- }
78-
79- export default async function StorePage ( { searchParams } : StorePageProps ) {
80- return (
81- < Suspense fallback = { < AgentsLoading /> } >
82- < AgentsDataProvider searchParams = { searchParams } />
83- </ Suspense >
84- )
85- }
0 commit comments