'use client' import Image from 'next/image'; import React, { useRef } from 'react'; import HTMLFlipBook from 'react-pageflip'; import { useMediaQuery } from '@react-hook/media-query'; interface Testimonial { image?: string; text: string; name: string; jobtitle: string; rating: number; } interface BookTestimonial3DProps { testimonials: Testimonial[]; } function BookTestimonial3D({ testimonials }: BookTestimonial3DProps) { const book = useRef(null); const isSmallScreen = useMediaQuery('(min-width: 640px)'); const smallerDevice = isSmallScreen ? false : true; const handleFlip = (pageNum: number) => { (book.current as any)?.pageFlip()?.flip(pageNum); (book.current as any)?.pageFlip()?.flipNext(false); } return (
console.log(e.data)} onChangeState={(e) => console.log(e.data)} className={''} style={{}} startPage={0} size={'fixed'} minWidth={0} maxWidth={0} minHeight={0} maxHeight={0} drawShadow={true} flippingTime={1000} startZIndex={0} autoSize={false} maxShadowOpacity={0} mobileScrollSupport={true} clickEventForward={true} useMouseEvents={true} swipeDistance={0} showPageCorners={true} disableFlipByClick={false}> {/* Cover Page */}
{/* Company Logo */}
Serenity UI Logo
{/* Company Name */}

Serenity UI

Read what virtual people are saying about us
{/* Index Page */}
Index
    {testimonials.map((testimonial, index) => (
  1. handleFlip(index + 2)} className="flex justify-start items-center text-xs cursor-pointer"> image {testimonial.name}
  2. {index + 2}
  3. ))}
{/* Testimonials Pages */} {testimonials.map((testimonial, index) => (
{index + 2}
image
{testimonial.name} {testimonial.jobtitle}
{testimonial.text}
{[...Array(testimonial.rating)].map((_, i) => ( ))} {[...Array(5 - testimonial.rating)].map((_, i) => ( ))}
))} {/* Back Cover */}

Thank You!

We appreciate your feedback

); } export default BookTestimonial3D;