"use client"; import PortableTextRenderer from "@/components/portable-text-renderer"; import { Badge } from "@/components/ui/badge"; import Image from "next/image"; import { urlFor } from "@/sanity/lib/image"; import { motion, useInView } from "motion/react"; import { useRef } from "react"; import { cn } from "@/lib/utils"; import { PAGE_QUERY_RESULT } from "@/sanity.types"; type Block = NonNullable["blocks"]>[number]; type SplitRow = Extract; type SplitInfoList = Extract< NonNullable[number], { _type: "split-info-list" } >; type SplitInfoItem = NonNullable[number]; export default function SplitCardsItem({ image, title, body, tags, }: SplitInfoItem) { const ref = useRef(null); const isInView = useInView(ref, { amount: 1, }); return (
{image && image.asset?._id && (
{image.alt
)} {title && (
{title}
)}
{body && }
{tags && (
{tags.map((tag) => ( {tag} ))}
)}
); }