|
| 1 | +import Image from 'next/image' |
| 2 | + |
| 3 | +const Testimonials = () => { |
| 4 | + const data = [ |
| 5 | + { |
| 6 | + name: 'Wahid Ari', |
| 7 | + imgUrl: '/placeholder/placeholder_1.png', |
| 8 | + userTitle: 'Designer', |
| 9 | + text: 'Gear Menyediakan informasi tools yang powerful untuk Designer, Developer, dan juga Business Owner agar bisa lebih produktif', |
| 10 | + rating: 2 |
| 11 | + }, |
| 12 | + { |
| 13 | + name: 'Wahid Ari', |
| 14 | + imgUrl: '/placeholder/placeholder_2.png', |
| 15 | + userTitle: 'Developer', |
| 16 | + text: 'Gear Menyediakan informasi tools yang powerful untuk Designer, Developer, dan juga Business Owner agar bisa lebih produktif', |
| 17 | + rating: 5 |
| 18 | + }, |
| 19 | + { |
| 20 | + name: 'Wahid Ari', |
| 21 | + imgUrl: '/placeholder/placeholder_3.png', |
| 22 | + userTitle: 'UI/UX Designer', |
| 23 | + text: 'Gear Menyediakan informasi tools yang powerful untuk Designer, Developer, dan juga Business Owner agar bisa lebih produktif', |
| 24 | + rating: 3 |
| 25 | + } |
| 26 | + ] |
| 27 | + |
| 28 | + return ( |
| 29 | + <section className='bg-gray-50 py-8'> |
| 30 | + <div className='container max-w-5xl mx-auto m-8'> |
| 31 | + <h1 className='w-full my-2 text-4xl font-bold leading-tight text-center text-gray-800'> |
| 32 | + Testimonials |
| 33 | + </h1> |
| 34 | + <p className='text-center text-gray-800 text-base px-6 mb-5 mx-10'> |
| 35 | + Community Members Experience |
| 36 | + </p> |
| 37 | + <div className='w-full mb-4'> |
| 38 | + <div className='h-1 mx-auto gradient w-64 opacity-25 my-0 py-0 rounded-t'></div> |
| 39 | + </div> |
| 40 | + </div> |
| 41 | + |
| 42 | + <div className='lg:container mx-auto flex flex-wrap pt-4 mb-8 px-8 pb-12'> |
| 43 | + <div className='items-center gap-6 text-black grid grid-cols-1 md:grid-cols-3'> |
| 44 | + {data.map(({ name, imgUrl, userTitle, rating, text }, index) => ( |
| 45 | + <div |
| 46 | + key={name + index} |
| 47 | + className='mx-auto flex flex-col justify-evenly h-full content-start p-6 shadow cursor-pointer rounded-md focus:outline-none focus:shadow-outline transform bg-white transition hover:shadow-lg hover:scale-105 duration-300 ease-in-out' |
| 48 | + > |
| 49 | + <div className='flex py-4'> |
| 50 | + <div className='flex items-center'> |
| 51 | + {Array.from(Array(Math.floor(rating)).keys()).map( |
| 52 | + (item, index) => ( |
| 53 | + <svg |
| 54 | + key={item + index} |
| 55 | + className='mx-1 w-4 h-4 fill-current text-yellow-500' |
| 56 | + xmlns='http://www.w3.org/2000/svg' |
| 57 | + viewBox='0 0 20 20' |
| 58 | + > |
| 59 | + <path d='M10 15l-5.878 3.09 1.123-6.545L.489 6.91l6.572-.955L10 0l2.939 5.955 6.572.955-4.756 4.635 1.123 6.545z' /> |
| 60 | + </svg> |
| 61 | + ) |
| 62 | + )} |
| 63 | + {Array.from(Array(5 - Math.floor(rating)).keys()).map( |
| 64 | + (item, index) => ( |
| 65 | + <svg |
| 66 | + key={item + index} |
| 67 | + className='mx-1 w-4 h-4 fill-current text-gray-400' |
| 68 | + xmlns='http://www.w3.org/2000/svg' |
| 69 | + viewBox='0 0 20 20' |
| 70 | + > |
| 71 | + <path d='M10 15l-5.878 3.09 1.123-6.545L.489 6.91l6.572-.955L10 0l2.939 5.955 6.572.955-4.756 4.635 1.123 6.545z' /> |
| 72 | + </svg> |
| 73 | + ) |
| 74 | + )} |
| 75 | + </div> |
| 76 | + </div> |
| 77 | + <p className='text-gray-600 text-base mb-2'>{text}</p> |
| 78 | + <div className='flex flex-row items-center justify-start py-2'> |
| 79 | + <div className='relative h-16 w-16 flex-shrink-0'> |
| 80 | + <Image |
| 81 | + src={imgUrl} |
| 82 | + alt={name} |
| 83 | + layout='fill' |
| 84 | + objectFit='contain' |
| 85 | + /> |
| 86 | + </div> |
| 87 | + |
| 88 | + <div className='flex flex-col justify-center pl-3'> |
| 89 | + <div className='w-full font-bold text-xl text-gray-800'> |
| 90 | + {name} |
| 91 | + </div> |
| 92 | + <p className='text-gray-800 text-base'>{userTitle}</p> |
| 93 | + </div> |
| 94 | + </div> |
| 95 | + </div> |
| 96 | + ))} |
| 97 | + </div> |
| 98 | + </div> |
| 99 | + </section> |
| 100 | + ) |
| 101 | +} |
| 102 | + |
| 103 | +export default Testimonials |
0 commit comments