Deploy
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
'use client'
|
||||
|
||||
import Image from 'next/image'
|
||||
import Link from 'next/link'
|
||||
import Badge from '@/components/ui/Badge'
|
||||
import { Card, CardContent } from '@/components/ui/Card'
|
||||
import { useVulaContent } from '@/hooks/useVulaContent'
|
||||
import { ArrowRight } from 'lucide-react'
|
||||
|
||||
interface PostData {
|
||||
title?: string
|
||||
excerpt?: string
|
||||
author?: string
|
||||
category?: string
|
||||
image?: string | null
|
||||
}
|
||||
|
||||
export default function SalonInsightsSection() {
|
||||
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="salon-insights" data-vula-section="salon-insights" data-vula-cms="posts" className="py-20 bg-white">
|
||||
<div className="mx-auto max-w-7xl px-4">
|
||||
<div className="max-w-2xl mb-10">
|
||||
<p className="text-sm font-medium text-[#00A8CC] mb-2">Hair care notes from our team</p>
|
||||
<h2 className="text-3xl font-bold text-[#1A2B3C]">Advice for braids, colour and treated hair</h2>
|
||||
<p className="mt-3 text-[#1A2B3C]/70">Practical maintenance tips, seasonal trends and honest product guidance.</p>
|
||||
</div>
|
||||
<div className="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
|
||||
{items.slice(0, 3).map((item) => {
|
||||
const d = item.data as PostData
|
||||
return (
|
||||
<Card key={item.id} className="rounded-xl overflow-hidden bg-white shadow-md flex flex-col md:flex-row">
|
||||
<div className="relative h-48 w-full md:w-1/3 md:min-h-full flex-shrink-0 overflow-hidden">
|
||||
{d.image ? (
|
||||
<Image src={d.image} alt={d.title ?? 'Salon insight'} fill sizes="(max-width: 768px) 100vw, 33vw" className="object-cover" />
|
||||
) : (
|
||||
<div className="h-full w-full bg-[#00A8CC]/20" />
|
||||
)}
|
||||
</div>
|
||||
<CardContent className="flex-1 p-5">
|
||||
{d.category && <Badge variant="secondary">{d.category}</Badge>}
|
||||
<h3 className="mt-2 font-bold text-[#1A2B3C]">{d.title}</h3>
|
||||
<p className="mt-2 text-sm text-[#1A2B3C]/70">{d.excerpt}</p>
|
||||
<div className="mt-4 flex items-center justify-between">
|
||||
{d.author && <span className="text-xs text-[#1A2B3C]/50">By {d.author}</span>}
|
||||
<Link href="/services" className="inline-flex items-center gap-1 text-sm font-medium text-[#0077BE] hover:underline">
|
||||
Read more <ArrowRight className="w-4 h-4" />
|
||||
</Link>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user