import Image from "next/image" import { useState, useRef, useEffect } from "react" import { useImageProxy } from "@/hooks/useImageProxy" import GenericButton from "@/components/buttons/GenericButton" import { useRouter } from "next/router" import useWindowWidth from "@/hooks/useWindowWidth" import { useToast } from "@/hooks/useToast"; import MessageCarousel from '@/components/content/carousels/MessagesCarousel'; // With current spacing the title can only be 1 line const promotions = [ { id: 1, category: "PLEBDEVS", title: "Content and Community platform", description: "One of a kind Nostr / Lightning integrated Content and Community platform.", icon: "pi pi-code", video: "https://plebdevs-bucket.nyc3.cdn.digitaloceanspaces.com/plebdevs-montage.mp4", }, { id: 2, category: "CONTENT", title: "Comprehensive Learning Resources", description: "Access the PlebDevs library of courses, videos, and documents.", icon: "pi pi-book", image: "https://media.istockphoto.com/id/1224500457/photo/programming-code-abstract-technology-background-of-software-developer-and-computer-script.jpg?s=612x612&w=0&k=20&c=nHMypkMTU1HUUW85Zt0Ff7MDbq17n0eVeXaoM9Knt4Q=", }, { id: 3, category: "COMMUNITY", title: "Join Our Community of learners / hackers", description: "Learn and connect with other developers, share your projects, and level up together.", icon: "pi pi-users", image: "https://pikwizard.com/pw/medium/50238b1cad4ff412fdafc1325efa1c9f.jpg", }, { id: 4, category: "LIGHTNING / NOSTR", title: "Lightning and Nostr integrated platform", description: "All content is published to and pulled from nostr relays and is fully interoperable with comments, zaps, and other nostr clients. Premium content is available for sale with lightning or by subscribing to plebdevs via a lightning subscription.", icon: "pi pi-bolt", image: "https://www.financemagnates.com/wp-content/uploads/2016/05/Bicoin-lightning.jpg", }, ] const yellowFocusOutlineStyle = "focus:shadow-[0_0_0_2px_rgba(255,255,255,1),0_0_0_4px_rgba(252,211,77,1),0_1px_2px_0_rgba(0,0,0,1)] dark:focus:shadow-[0_0_0_2px_rgba(28,33,39,1),0_0_0_4px_rgba(252,211,77,0.7),0_1px_2px_0_rgba(0,0,0,0)]" const InteractivePromotionalCarousel = () => { const [selectedPromotion, setSelectedPromotion] = useState(promotions[0]) const { returnImageProxy } = useImageProxy(); const { showToast } = useToast(); const windowWidth = useWindowWidth(); const isTabView = windowWidth <= 1360; const isMobile = windowWidth <= 768; const router = useRouter(); const videoRef = useRef(null); const copyToClipboard = async (text) => { try { await navigator.clipboard.writeText(text); showToast("success", "Copied", "Copied Lightning Address to clipboard"); if (window && window?.webln && window?.webln?.lnurl) { await window.webln.enable(); const result = await window.webln.lnurl("austin@bitcoinpleb.dev"); if (result && result?.preimage) { showToast("success", "Payment Sent", "Thank you for your donation!"); } } } catch (err) { console.error('Failed to copy:', err); } }; useEffect(() => { if (videoRef.current && selectedPromotion.video) { videoRef.current.play(); } }, [selectedPromotion]); return (
{selectedPromotion.video ? (
); } export default InteractivePromotionalCarousel;