Deploy
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
'use client'
|
||||
|
||||
import { useVulaContent } from '@/hooks/useVulaContent'
|
||||
import Image from 'next/image'
|
||||
import { Card, CardContent } from '@/components/ui/Card'
|
||||
import Badge from '@/components/ui/Badge'
|
||||
|
||||
export default function StyleDiariesSection() {
|
||||
const { items, loading } = useVulaContent('posts')
|
||||
|
||||
if (loading) return <div className="flex justify-center py-16"><div className="w-8 h-8 rounded-full border-2 border-[#0077BE] border-t-transparent animate-spin" /></div>
|
||||
if (items.length === 0) return null
|
||||
|
||||
return (
|
||||
<section id="style-diaries" className="py-20 bg-[#FFFFFF]" data-vula-section="stylediaries" data-vula-cms="posts">
|
||||
<div className="max-w-7xl mx-auto px-4">
|
||||
<h2 className="text-3xl font-bold text-[#1A2B3C] mb-2">Style Diaries</h2>
|
||||
<p className="text-[#1A2B3C]/60 mb-10">Trend reports, how-to-wear guides, and behind-the-scenes stories.</p>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{items.slice(0, 6).map((item) => {
|
||||
const d = item.data as { title?: string; excerpt?: string; body?: string; author?: string; category?: string; image?: string }
|
||||
return (
|
||||
<Card key={item.id} className="rounded-xl overflow-hidden bg-white shadow-md hover:shadow-lg transition-shadow">
|
||||
{d.image ? (
|
||||
<div className="relative h-48 w-full overflow-hidden">
|
||||
<Image src={d.image} alt={d.title || ''} fill sizes="(max-width: 768px) 100vw, 33vw" className="object-cover" />
|
||||
</div>
|
||||
) : (
|
||||
<div className="h-48 bg-gray-200 flex items-center justify-center text-gray-500">No image</div>
|
||||
)}
|
||||
<CardContent className="p-5">
|
||||
{d.category && <Badge variant="accent" className="mb-2 bg-[#00A8CC] text-white text-xs">{d.category}</Badge>}
|
||||
<h3 className="font-bold text-lg text-[#1A2B3C]">{d.title}</h3>
|
||||
{d.excerpt && <p className="text-[#1A2B3C]/70 text-sm mt-2 line-clamp-2">{d.excerpt}</p>}
|
||||
{d.author && <p className="text-xs text-[#1A2B3C]/50 mt-3">By {d.author}</p>}
|
||||
</CardContent>
|
||||
</Card>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user