import { Button, Typography } from "@carrot-kpi/ui"; import React /* , { useCallback, useEffect, useRef, useState } */ from "react"; import { CardHorizontal } from "../../components/ui/cards-horizontal"; import { Link } from "react-router-dom"; import Plus from "../../icons/plus"; import { useTranslation } from "react-i18next"; import { cva } from "class-variance-authority"; import { CreateCampaignButton } from "../../components/create-campaign-button"; // import { useSelector } from "../../state/hooks"; // import type { HostState } from "../../state"; import { KPITokenCard } from "../../components/ui/kpi-token-card"; import { NAVBAR_LINKS } from "../../constants"; // import PlayVideo from "../../icons/play-video"; import VideoPoster from "../../images/video-poster.png"; import type { KPIToken } from "@carrot-kpi/sdk"; import { Navbar } from "../../components/ui/navbar"; import { Environment } from "@carrot-kpi/shared-state"; const plusIconStyles = cva(["invisible", "md:visible", "absolute"], { variants: { x: { left: ["left-4"], right: ["right-4"], }, y: { top: ["top-10"], middle: ["top-1/3"], bottom: ["bottom-10"], }, }, }); export interface HeroProps { featuredKPITokens: KPIToken[]; } export const Hero = ({ featuredKPITokens }: HeroProps) => { const { t } = useTranslation(); // const videoRef = useRef(null); // const modalOpen = useSelector((state) => state.modals.open); // const [showVideo, setShowVideo] = useState(false); // const handleClick = useCallback(() => { // setShowVideo(true); // if (!videoRef || !videoRef.current) return; // videoRef.current.play(); // }, []); // const handleDismiss = useCallback(() => { // setShowVideo(false); // if (!videoRef || !videoRef.current) return; // videoRef.current.pause(); // setTimeout(() => { // if (!videoRef || !videoRef.current) return; // videoRef.current.currentTime = 0; // }, 300); // }, []); // useEffect(() => { // if (!videoRef || !videoRef.current) return; // if (modalOpen) videoRef.current.pause(); // }, [modalOpen]); return (
{featuredKPITokens.length === 0 ? (
{t("home.noFeatured.title")}
{t("home.noFeatured.description")}
poster {/*
*/}
) : (
{t("home.featuredCampaigns")}
{featuredKPITokens.map((kpiToken) => ( ))}
{__ENVIRONMENT__ !== Environment.Local && ( )}
)}
); };