This commit is contained in:
Vula Builder
2026-06-23 08:47:40 +00:00
parent b70cf19fb8
commit 3fa568bc98
@@ -0,0 +1,73 @@
'use client'
import { useMedusaProducts } from "@/hooks/useMedusaProducts"
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from "@/components/ui/Card"
import Button from "@/components/ui/Button"
import Link from "next/link"
import { Star } from 'lucide-react'
export default function ServicesSection() {
const { products: services, isLoading } = useMedusaProducts(8)
if (isLoading) {
return (
<section data-vula-section="services" id="services" className="py-20 bg-neutral-50">
<div className="container mx-auto px-4 max-w-7xl text-center">
<Star className="h-12 w-12 animate-spin mx-auto text-[#000080]" />
<p className="mt-4 text-muted-foreground">Loading practice areas...</p>
</div>
</section>
)
}
if (!services || services.length === 0) {
return null
}
const formatPrice = (amount: number, code?: string) => {
const sym: Record<string, string> = { zar: "R", usd: "$", eur: "\u20AC", gbp: "\u00A3" }
const s = sym[(code ?? "").toLowerCase()] ?? (code?.toUpperCase() ?? "")
return `${s}${(amount / 100).toFixed(2)}`
}
return (
<section id="services" className="py-20 bg-neutral-50">
<div className="container mx-auto px-4 max-w-7xl">
<div className="text-center mb-12">
<h2 className="text-3xl md:text-4xl font-serif italic text-[#000080] mb-4">Our Practice Areas</h2>
<p className="text-lg text-muted-foreground max-w-2xl mx-auto">
Specialised legal services for corporate executives, property developers, and business owners.
</p>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
{services.slice(0, 8).map((service) => {
const price = service.variants?.[0]?.prices?.[0]
return (
<Card key={service.id} className="group hover:shadow-[var(--shadow-lifted)] hover:-translate-y-0.5 transition-all duration-200 ease-out border border-neutral-100 cursor-pointer">
<CardHeader>
<CardTitle className="text-xl font-semibold text-foreground group-hover:text-[#000080] transition-colors">{service.title}</CardTitle>
{price && (
<p className="text-sm font-medium text-[#800000]">
{formatPrice(price.amount, price.currency_code)}
</p>
)}
</CardHeader>
<CardContent>
<CardDescription className="text-muted-foreground line-clamp-3">
{service.description || "Comprehensive legal counsel tailored to your business needs."}
</CardDescription>
</CardContent>
<CardFooter>
<Link href={"/booking/" + service.id} className="w-full">
<Button variant="secondary" size="sm" className="w-full border-[#000080] text-[#000080] hover:bg-[#000080] hover:text-white transition-all duration-200">
Book Consultation
</Button>
</Link>
</CardFooter>
</Card>
)
})}
</div>
</div>
</section>
)
}