@@ -10,6 +10,7 @@ import JsonTreeContainer, { JsonTree } from "@/components/JsonTree";
1010import ApiButtons from "@/components/ApiButtons" ;
1111import VisitCounter from "@/components/VisitCounter" ;
1212import type { ApiVersion } from "@/types/api" ;
13+ import { ExternalLink } from "lucide-react" ;
1314
1415function stripMarkdown ( markdown : string ) : string {
1516 return markdown
@@ -24,7 +25,7 @@ function stripMarkdown(markdown: string): string {
2425}
2526export function getData (
2627 providerSlug : string ,
27- serviceSlug ?: string | null ,
28+ serviceSlug ?: string | null
2829) : any | null {
2930 const apiList = list as Record < string , any > ;
3031
@@ -46,7 +47,7 @@ export function getData(
4647 }
4748
4849 console . warn (
49- `No API found for provider: ${ providerSlug } , service: ${ serviceSlug } ` ,
50+ `No API found for provider: ${ providerSlug } , service: ${ serviceSlug } `
5051 ) ;
5152 return null ;
5253}
@@ -89,7 +90,7 @@ function processApiData(key: string, api: any) {
8990 version,
9091 swaggerUrl : details ?. swaggerUrl || "" ,
9192 swaggerYamlUrl : details ?. swaggerYamlUrl || "" ,
92- } ) ,
93+ } )
9394 ) ;
9495
9596 const description = info . description || "No description available" ;
@@ -138,15 +139,14 @@ export async function generateStaticParams() {
138139 }
139140 }
140141
141-
142142 return params ;
143143}
144144
145145export async function generateMetadata (
146146 {
147147 params,
148148 } : { params : Promise < { providerSlug : string ; serviceSlug : string } > } ,
149- parent : ResolvingMetadata ,
149+ parent : ResolvingMetadata
150150) : Promise < Metadata > {
151151 const { providerSlug, serviceSlug } = await params ;
152152 const api = getData ( providerSlug , serviceSlug ) ;
@@ -217,72 +217,73 @@ export default async function ApiPage({
217217 }
218218
219219 return (
220- < div className = "container mx-auto p-6 max-w-4xl " >
220+ < div className = "container mx-auto p-6 max-w-6xl " >
221221 < VisitCounter providerSlug = { providerSlug } serviceSlug = { serviceSlug } />
222222
223223 < div className = "flex flex-col md:flex-row gap-6 mb-8" >
224224 < div className = "flex-shrink-0" >
225- < Image
226- src = { api . logo . url }
227- alt = { `${ api . info . title } API logo` }
228- width = { 200 }
229- height = { 200 }
230- className = "max-w-full max-h-[200px] p-[10px]"
231- style = { {
232- backgroundColor : api . logo . backgroundColor || "transparent" ,
233- } }
234- />
225+ < div className = "bg-white rounded-lg px-6 " >
226+ < Image
227+ src = { api . logo . url }
228+ alt = { `${ api . info . title } API logo` }
229+ width = { 200 }
230+ height = { 200 }
231+ className = "max-w-full max-h-[200px] mx-auto"
232+ style = { {
233+ backgroundColor : api . logo . backgroundColor || "transparent" ,
234+ } }
235+ />
236+ </ div >
235237 </ div >
236238
237239 < div className = "flex-grow" >
238- < div className = "text-3xl font-bold text-[#388c9a] mb-2 gap-6 flex items-center" >
239- { api . externalUrl ? (
240- < Link
241- href = { api . externalUrl }
242- target = "_blank"
243- className = "hover:underline text-decoration-line:none text-[#388c9a]"
244- >
245- { api . info . title }
246- </ Link >
247- ) : (
248- api . info . title
249- ) }
250- { /* <Badge variant="outline" className="text-sm">
251- <span className="text-sm text-gray-500">OpenAPI / Swagger</span>
252- </Badge> */ }
253- </ div >
240+ < div className = "mb-6" >
241+ < h1 className = "text-4xl font-bold text-gray-900 mb-3" >
242+ { api . externalUrl ? (
243+ < Link
244+ href = { api . externalUrl }
245+ target = "_blank"
246+ className = "hover:text-[#388c9a] transition-colors duration-200"
247+ >
248+ { api . info . title }
249+ </ Link >
250+ ) : (
251+ api . info . title
252+ ) }
253+ </ h1 >
254+
255+ < p className = "text-lg text-gray-600 mb-4" >
256+ Last updated:{ " " }
257+ { new Date ( api . updated ) . toLocaleString ( "en-US" , {
258+ year : "numeric" ,
259+ month : "long" ,
260+ day : "numeric" ,
261+ } ) }
262+ </ p >
254263
255- < h3 className = "text-lg mb-4" >
256- Last updated at:{ " " }
257- { new Date ( api . updated ) . toLocaleString ( "en-US" , {
258- year : "numeric" ,
259- month : "long" ,
260- day : "numeric" ,
261- } ) }
262- </ h3 >
263-
264- < div className = "relative flex flex-wrap gap-3 mb-6" >
265- < div className = "flex flex-wrap gap-3" >
264+ < div className = "mb-6" >
266265 < ApiButtons
267266 swaggerUrl = { api . api . swaggerUrl }
268- swaggerYamlUrl = { api . api . swaggerYamlUrl }
269- origUrl = { api . origUrl }
270267 title = { api . info . title }
271268 />
272269 </ div >
273270 </ div >
271+
274272 { api . integrations && api . integrations . length > 0 && (
275273 < div className = "mb-6" >
276- < h4 className = "text-lg font-semibold mb-3" > Tools</ h4 >
277- < div className = "flex flex-wrap gap-2" >
274+ < h3 className = "text-xl font-semibold mb-3 text-gray-900" >
275+ Available Tools
276+ </ h3 >
277+ < div className = "flex flex-wrap gap-3" >
278278 { api . integrations . map ( ( integration : any , index : any ) => (
279279 < Link
280280 key = { index }
281281 href = { integration . template }
282282 target = "_blank"
283- className = "py-1 px-3 bg-gray-600 rounded text-white text-sm hover:bg-gray-700 "
283+ className = "inline-flex items-center px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-800 rounded-lg transition-colors duration-200 text-sm font-medium "
284284 >
285285 { integration . text }
286+ < ExternalLink className = "w-3 h-3 ml-1" />
286287 </ Link >
287288 ) ) }
288289 </ div >
@@ -294,29 +295,48 @@ export default async function ApiPage({
294295 < DescriptionSection description = { api . cardDescription } />
295296
296297 < div className = "mb-8" >
297- < h2 className = "text-2xl font-bold mb-4" > OpenAPI/Swagger JSON</ h2 >
298-
299- < JsonTreeContainer swaggerUrl = { api . api . swaggerUrl } />
298+ < h2 className = "text-3xl font-bold mb-6 text-gray-900" >
299+ OpenAPI Specification
300+ </ h2 >
301+ < JsonTreeContainer
302+ swaggerUrl = { api . api . swaggerUrl }
303+ swaggerYamlUrl = { api . api . swaggerYamlUrl }
304+ title = { api . info . title }
305+ />
300306 </ div >
301307
302308 { api . versions && api . versions . length > 0 && (
303309 < div >
304- < h2 className = "text-2xl font-bold mb-4" > All Versions</ h2 >
310+ < h2 className = "text-3xl font-bold mb-6 text-gray-900" >
311+ All Versions
312+ </ h2 >
305313 < div className = "space-y-4" >
306314 { api . versions
307315 . reverse ( )
308316 . map ( ( version : ApiVersion , index : number ) => (
309317 < div
310318 key = { index }
311- className = "flex items-center justify-between p-4 bg-gray-50 rounded "
319+ className = "bg-white border rounded-lg p-6 shadow-sm "
312320 >
313- < span className = "font-semibold" > { version . version } </ span >
314- < div className = "flex gap-2" >
321+ < div className = "flex items-center justify-between mb-4" >
322+ < h3 className = "text-xl font-semibold text-gray-900" >
323+ Version { version . version }
324+ </ h3 >
315325 < ApiButtons
326+ swaggerUrl = { version . swaggerUrl }
327+ title = { api . info . title }
328+ version = { version . version }
329+ />
330+ </ div >
331+
332+ < div className = "mb-4" >
333+ < h4 className = "text-lg font-medium mb-3 text-gray-800" >
334+ OpenAPI Specification
335+ </ h4 >
336+ < JsonTreeContainer
316337 swaggerUrl = { version . swaggerUrl }
317338 swaggerYamlUrl = { version . swaggerYamlUrl }
318- origUrl = { `https://redocly.github.io/redoc/?url=${ version . swaggerUrl } ` }
319- title = { `${ api . info . title } -v${ version . version } ` }
339+ title = { api . info . title }
320340 version = { version . version }
321341 />
322342 </ div >
0 commit comments