1
1
'use client' ;
2
2
import { withBase } from '@/app/lib/basepath' ;
3
+ import { formatDate } from '@/app/lib/date-utils' ;
3
4
4
5
import { useState } from 'react' ;
5
6
import Link from 'next/link' ;
@@ -16,10 +17,10 @@ interface SkyboxClientProps {
16
17
17
18
export default function SkyboxClient ( { slug, skyboxData, previewCount } : SkyboxClientProps ) {
18
19
const [ activeImage , setActiveImage ] = useState ( 1 ) ;
19
- console . log ( activeImage )
20
20
const imgBase = withBase ( `/skyboxes/${ slug } /images` ) ;
21
21
// Generate array of preview numbers based on previewCount
22
22
const previews = Array . from ( { length : previewCount } , ( _ , i ) => i + 1 ) ;
23
+ const publishDate = formatDate ( skyboxData . publishDate )
23
24
24
25
return (
25
26
< div className = "max-w-7xl min-h-screen mx-auto px-4 sm:px-6 lg:px-8 py-8" >
@@ -40,7 +41,6 @@ export default function SkyboxClient({ slug, skyboxData, previewCount }: SkyboxC
40
41
< div className = "flex flex-col md:flex-row md:items-center md:justify-between gap-6" >
41
42
< div >
42
43
< h1 className = "text-3xl md:text-4xl font-bold bg-gradient-to-r from-blue-400 to-purple-500 bg-clip-text text-transparent" >
43
- { /*{slug.replace(/_/g, ' ').replace(/\b\w/g, l => l.toUpperCase())}*/ }
44
44
{ slug }
45
45
</ h1 >
46
46
< div className = "mt-2 space-y-1" >
@@ -62,11 +62,7 @@ export default function SkyboxClient({ slug, skyboxData, previewCount }: SkyboxC
62
62
</ a >
63
63
{ skyboxData . publishDate && (
64
64
< span className = "text-neutral-500 text-xs ml-2" >
65
- • Published { new Date ( skyboxData . publishDate ) . toLocaleDateString ( 'en-US' , {
66
- year : 'numeric' ,
67
- month : 'short' ,
68
- day : 'numeric' ,
69
- } ) }
65
+ • Published { publishDate }
70
66
</ span >
71
67
) }
72
68
</ p >
@@ -91,9 +87,7 @@ export default function SkyboxClient({ slug, skyboxData, previewCount }: SkyboxC
91
87
alt = { `${ slug } skybox preview ${ activeImage } ` }
92
88
className = "w-full h-full object-cover transition-opacity duration-300"
93
89
/>
94
- < div className = "absolute inset-0 bg-gradient-to-t from-black/80 to-transparent opacity-0 hover:opacity-100 transition-opacity flex items-end p-6" >
95
- < p className = "text-white text-sm" > Preview angle: { activeImage } /{ previews . length } </ p >
96
- </ div >
90
+
97
91
</ div >
98
92
99
93
{ /* Thumbnail Grid */ }
0 commit comments