refactor: replace hardcoded testimonials with dynamic data from JSON
This commit is contained in:
@@ -1,27 +1,9 @@
|
|||||||
|
import TESTIMONIALS from '@/data/testimonials.json';
|
||||||
import { Button } from '@components';
|
import { Button } from '@components';
|
||||||
|
import Image from 'next/image';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { BsChatLeftQuote } from 'react-icons/bs';
|
import { BsChatLeftQuote } from 'react-icons/bs';
|
||||||
|
import { FaQuoteLeft } from 'react-icons/fa';
|
||||||
const testimonials = [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
name: 'User 1',
|
|
||||||
date: 'April 2025',
|
|
||||||
text: 'Bergabung dengan komunitas ini memberikan saya banyak inspirasi. Saya belajar banyak hal baru dan bertemu dengan orang-orang yang luar biasa.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
name: 'User 2',
|
|
||||||
date: 'Maret 2025',
|
|
||||||
text: 'Pengalaman yang sangat berharga. Saya mendapatkan banyak wawasan baru dan dapat mengembangkan keterampilan menulis saya dengan lebih baik.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
name: 'User 3',
|
|
||||||
date: 'Maret 2025',
|
|
||||||
text: 'Komunitas ini sangat mendukung dan memotivasi. Saya senang bisa menjadi bagian dari perjalanan ini dan berbagi pengalaman dengan sesama anggota.',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
return (
|
return (
|
||||||
@@ -38,30 +20,36 @@ export default function Page() {
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Testimonial Cards */}
|
<div className="grid gap-8 md:gap-6 grid-cols-1 md:grid-cols-2 lg:grid-cols-3 my-16 container">
|
||||||
<div className="max-w-7xl mx-auto px-4 py-12">
|
{TESTIMONIALS.map((testimonial) => (
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
<div
|
||||||
{testimonials.map((testimonial) => (
|
key={testimonial.id}
|
||||||
<div
|
className="p-6 bg-white rounded-xl shadow-sm hover:shadow-md transition-shadow duration-300"
|
||||||
key={testimonial.id}
|
>
|
||||||
className="border rounded-lg p-6 shadow-sm bg-card border-border"
|
<div className="flex flex-col space-y-4">
|
||||||
>
|
<div className="flex items-center gap-4">
|
||||||
<div className="flex items-center mb-4">
|
<Image
|
||||||
|
src={testimonial.image}
|
||||||
|
alt={testimonial.name}
|
||||||
|
width={48}
|
||||||
|
height={48}
|
||||||
|
className="w-12 h-12 rounded-full object-cover"
|
||||||
|
unoptimized
|
||||||
|
/>
|
||||||
<div>
|
<div>
|
||||||
<h3 className="font-semibold text-foreground">
|
<h4 className="font-semibold text-gray-900">
|
||||||
{testimonial.name}
|
{testimonial.name}
|
||||||
</h3>
|
</h4>
|
||||||
<p className="text-sm text-muted-foreground">
|
<p className="text-sm text-gray-600">{testimonial.role}</p>
|
||||||
Lulus: {testimonial.date}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-foreground/80 italic">
|
<div className="text-gray-600 relative">
|
||||||
"{testimonial.text}"
|
<FaQuoteLeft className="text-primary-500/30 w-6 h-6 mb-2" />
|
||||||
</p>
|
<p className="text-sm/relaxed">{testimonial.text}</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
))}
|
</div>
|
||||||
</div>
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user