import { AnimatePresence, motion } from "motion/react"; import { requestScopedT as i18nT } from "~/locale/request-scoped-t"; import { useState } from "react"; import LinkOrAhref from "../ui/buttons/LinkOrAhref"; import clsx from "clsx"; import CheckIcon from "../ui/icons/CheckIcon"; import { Colors } from "~/application/enums/shared/Colors"; import Modal from "../ui/modals/Modal"; import XIcon from "../ui/icons/XIcon"; import ExternalLinkEmptyIcon from "../ui/icons/ExternalLinkEmptyIcon"; import { Link } from "react-router"; export interface HoverEffectItem { name: string; description?: string; img?: string; className?: string; link?: { text?: string; href: string; target?: undefined | "_blank"; }; subFeatures?: { name: string; description?: string; }[]; highlight?: { text: string; color?: Colors; }; disabled?: boolean; } export const HoverEffect = ({ items }: { items: HoverEffectItem[] }) => { let [hoveredIndex, setHoveredIndex] = useState(null); const [selectedImage, setSelectedImage] = useState(null); const [showImage, setShowImage] = useState(false); return (
1 && "md:grid-cols-2", items.length === 2 && "lg:grid-cols-2", items.length === 3 && "lg:grid-cols-3", items.length === 4 && "lg:grid-cols-4", items.length > 4 && "lg:grid-cols-3" )} > {items.map((item, idx) => ( setHoveredIndex(idx)} onMouseLeave={() => setHoveredIndex(null)} > {hoveredIndex === idx && ( )}

{item.highlight && (
{item.highlight.text}
)}

{item.description}

{item.img && (
)} {item.subFeatures && (
{item.subFeatures.map((subFeature, idx) => (
))}
)}
))} setShowImage(false)}>

{selectedImage?.name}

{selectedImage?.link && (
)}

{selectedImage?.description}

{selectedImage && {selectedImage.name}}
); }; function Name({ item }: { item: HoverEffectItem }) { switch (item.name) { default: return item.name; } }