import { useRef } from "react"; import { useScroll, useTransform, motion } from "motion/react"; import type { LucideIcon } from "lucide-react"; import { Quote } from "lucide-react"; import ImageOrVideo from "@/components/ui/ImageOrVideo"; import TextAnimation from "@/components/ui/TextAnimation"; import { useButtonClick } from "@/hooks/useButtonClick"; import { resolveIcon } from "@/utils/resolve-icon"; type SocialLink = { icon: string | LucideIcon; label: string; href?: string; onClick?: () => void; }; type AboutTestimonialParallaxProps = { tag: string; quote: string; author: string; role: string; socialLinks?: SocialLink[]; } & ({ imageSrc: string; videoSrc?: never } | { videoSrc: string; imageSrc?: never }); const SocialLinkButton = ({ icon, label, href, onClick }: SocialLink) => { const Icon = resolveIcon(icon); const handleClick = useButtonClick(href, onClick); return ( {label} ); }; const AboutTestimonialParallax = ({ tag, quote, author, role, imageSrc, videoSrc, socialLinks, }: AboutTestimonialParallaxProps) => { const imageRef = useRef(null); const { scrollYProgress } = useScroll({ target: imageRef, offset: ["start end", "end start"], }); const imageScale = useTransform(scrollYProgress, [0, 0.6], [1.3, 1]); return ( {tag} {author} • {role} {socialLinks && socialLinks.length > 0 && ( {socialLinks.map((link, index) => ( ))} )} ); }; export default AboutTestimonialParallax;
{tag}