import { useEffect, useState } from "react"; import { codeToHtml } from "shiki"; export function FeaturesSection() { const [highlightedCode, setHighlightedCode] = useState(""); const [highlightedGraphQLCode, setHighlightedGraphQLCode] = useState(""); const codeExample = `const resp = await client.com.recordcollector.album.getRecords({ where: { artist: { eq: "Nirvana" } }, sortBy: [{ field: "releaseDate", direction: "desc" }] });`; const graphQLExample = `query MyGalleries { socialGrainGalleries( where: { actorHandle: { eq: "chadtmiller.com" } } ) { title socialGrainFavoritesCount # Reverse: all favorites socialGrainGalleryItems { # Reverse: all items position socialGrainPhoto { # Forward: follow item→photo alt aspectRatio socialGrainPhotoExifs { # Reverse: photo EXIF data fNumber iSO } } } } }`; useEffect(() => { const generateHighlightedCode = async () => { const html = await codeToHtml(codeExample, { lang: "typescript", theme: "ayu-dark", }); const styledCode = html.replace( '
 {
    const generateGraphQLCode = async () => {
      const html = await codeToHtml(graphQLExample, {
        lang: "graphql",
        theme: "ayu-dark",
      });

      const styledCode = html.replace(
        '
      
{/* Feature 1 */}
01

Auto-Indexing Engine

Automatically discover and index records matching your lexicons. Real-time data sync from the AT Protocol firehose.

{/* Feature 2 */}
02

Schema Management

Deploy lexicons that instantly become queryable collections. Built-in validation ensures your schemas work correctly from day one.

{/* Feature 3 */}
03

Type-Safe APIs

{highlightedCode ?
: (
                  {codeExample}
                
)}

Generated clients with getRecords(), createRecord(), updateRecord(), and deleteRecord(). Full TypeScript support with filtering, sorting, and pagination.

{/* Feature 4 */}
04

Lexicon-to-GraphQL Mapping

{highlightedGraphQLCode ?
: (
                  {graphQLExample}
                
)}

Lexicons map directly to GraphQL schema with automatic relationship resolution. Forward joins traverse at-uri references. Reverse joins find all records pointing back. Query deeply nested data structures in a single efficient request.

{/* Feature 5 */}
05

User Authentication

Production-ready OAuth 2.0 with PKCE and Device Code flows. Automatic token management, refresh handling, and secure session storage.

); }