import { Button } from '@/components/ui/button'; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger, } from '@/components/ui/dialog'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Textarea } from '@/components/ui/textarea'; import FilePondPluginImageExifOrientation from 'filepond-plugin-image-exif-orientation'; import FilePondPluginImagePreview from 'filepond-plugin-image-preview'; import 'filepond-plugin-image-preview/dist/filepond-plugin-image-preview.css'; import 'filepond/dist/filepond.min.css'; import { Star } from 'lucide-react'; import { FilePond, registerPlugin } from 'react-filepond'; import 'swiper/css'; import 'swiper/css/navigation'; import 'swiper/css/pagination'; import { Swiper, SwiperSlide } from 'swiper/react'; import { useTranslations } from '@/utils/i18n'; import { useForm } from '@inertiajs/react'; import { useEffect, useState } from 'react'; import { toast } from 'sonner'; import { Pagination } from 'swiper/modules'; // const testimonial = [ // { // name: 'Priya Sharada', // company: 'Sharada Group', // review: 'What impressed me the most was the attention to detail and the evident care put into making the rug, It has become a center piece in my living room, gathering compliments from everyone who sees it. If you are considering handmade rugs, I highly recommend Kaleen.', // img: testimonial1, // }, // { // name: 'Kedar Bhakta Mathema', // company: // 'Former VC of Tribhuwan University, Nepal, Former Nepalese Ambassador to Japan', // review: 'I am delighted to recommend Kaleen Carpet in Kathmandu to anyone seeking skilled carpet weavers. What impressed me most about Kaleen was their willingness to make several changes to the design at my request without any hesitation. I find Kaleen to be highly professional and trustworthy in all their dealings.', // img: testimonial3, // }, // { // name: 'Ani Rudra Silwal and Srijana Silwal', // company: 'USA', // review: "Thank you for making these carpets for us! We couldn't be more pleased with them. The entire process - from the custom design to shipping - was seamless and very professional. We look forward to having these beautiful Nepali handmade carpets in our home for many years to come!", // img: testimonial1, // }, // { // name: 'Manila Pradhan and Bhaskar Joshi', // company: 'USA', // review: 'We absolutely love the carpet. Thank you so much for the excellent design and execution.', // img: testimonial2, // }, // ]; export default function Testimonial({ testimonial, }: { testimonial: [ { name: string; location: string; image: string; description: string; }, ]; }) { // eslint-disable-next-line @typescript-eslint/no-explicit-any const [file, setFile] = useState(null); const [open, setOpen] = useState(false); const { data, setData, post, processing, errors } = useForm({ name: '', location: '', description: '', image: null as File | null, }); registerPlugin( FilePondPluginImageExifOrientation, FilePondPluginImagePreview, ); useEffect(() => { if (file) { setData('image', file.file); } }, [file, setData]); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); post('/testimonial', { // forceFormData: true, onSuccess: () => { toast.success('Testimonial successfully uploaded!'); setOpen(false); setFile(null); setData({ name: '', location: '', description: '', image: null, }); }, }); }; const { t } = useTranslations(); return ( <>

{t('pages.home.sections.testimonial.title')}

{/*
{testimonial.map((review) => (
{review.name}

{review.name}

{review.location}

{review.description}

))}
*/}
{testimonial.map((review) => (
{review.name}

{review.name}

{review.location}

{review.description}

))}
Give your testimonial
setData('name', e.target.value) } />
setData('location', e.target.value) } />