import { GetProductPromptsDocument, GetProductPromptsQuery } from "@/graphql"; import { useQuery } from "@apollo/client"; import { useLayoutEffect, useRef, useState } from "react"; type Props = { slug: string; description?: string | null; technicalVersion?: string | null; technicalURL?: string | null; onPromptClick?: (prompt: string) => void; inAIModel?: number; }; const OverviewPane: React.FC = ({ slug, description, technicalVersion, technicalURL, onPromptClick, inAIModel, }) => { const ref = useRef(null); const [read, setRead] = useState(true); const [height, setHeight] = useState(0); const { loading, error, data } = useQuery( GetProductPromptsDocument, { variables: { productSlug: slug }, } ); useLayoutEffect(() => { if (!ref.current) return; setHeight(ref.current?.offsetHeight); }, [read]); return (

About this AI

{description}

Model Version {technicalVersion}

Try it yourself

    {data?.prompts.map((prompt, index) => { const showBorder = index !== data?.prompts.length - 1; return ( ); })}
); }; export default OverviewPane;