import SectionContainer from '~/components/Layouts/SectionContainer' import Panel from '~/components/Panel' import { getAnimation, INITIAL_BOTTOM } from '~/lib/animations' import { domAnimation, LazyMotion, m, useInView } from 'motion/react' import React, { useRef, useState } from 'react' interface Highlight { image?: React.ReactNode svg?: React.ReactNode title: string paragraph: string | React.ReactNode } const HighlightCards = ({ highlights, className, }: { highlights: Highlight[] className?: string cols?: number }) => { return (
{highlights.map((highlight, i) => ( ))}
) } const HighlightCard = ({ highlight, index }: { highlight: Highlight; index: number }) => { const ref = useRef(null) const [isHovered, setIsHovered] = useState(false) const isInView = useInView(ref, { once: true }) const initial = INITIAL_BOTTOM const animate = getAnimation({}) const Img: any = highlight.image return ( setIsHovered(true)} onMouseLeave={() => setIsHovered(false)} animate={isInView ? animate : initial} className="will-change-transform h-full highlight-card" > {highlight.image && (
{highlight.image && }
)}
{highlight.svg && (
{highlight.svg}
)}

{highlight.title}

{highlight.paragraph}

) } export default HighlightCards