import { cn } from "@/lib/utils"; import PortableTextRenderer from "@/components/portable-text-renderer"; import { Button } from "@/components/ui/button"; import Link from "next/link"; import TagLine from "@/components/ui/tag-line"; import { createElement } from "react"; import { PAGE_QUERY_RESULT } from "@/sanity.types"; type Block = NonNullable["blocks"]>[number]; type SplitRow = Extract; type SplitContent = Extract< NonNullable[number], { _type: "split-content" } >; interface SplitContentProps extends SplitContent { noGap?: boolean; } export default function SplitContent({ sticky, padding, noGap, tagLine, title, body, link, }: SplitContentProps) { return (
{tagLine && } {title && createElement( tagLine ? "h3" : "h2", { className: cn("my-4 font-semibold leading-[1.2]"), }, title, )} {body && } {link?.href && (
)}
); }