UNPKG

strapi-nextgen-framework

Version:

Production-ready, type-safe framework bridging Strapi v4 CMS and Next.js 14+ App Router with automatic cache management, Error Boundaries, and SEO optimization

42 lines 1.23 kB
/** * Strapi Image Component - Phase 4 Implementation * Optimized image component with next/image integration */ /// <reference types="react" /> import { type ImageProps } from 'next/image'; import type { StrapiMedia } from '../types'; /** * Props for StrapiImage component */ export interface StrapiImageProps { /** Strapi media object */ data: StrapiMedia; /** Additional props to pass to next/image */ nextImageProps?: Omit<ImageProps, 'src' | 'alt' | 'width' | 'height'>; /** Fallback image URL if Strapi image is missing */ fallback?: string; } /** * Optimized image component for Strapi media * * Features: * - Automatic responsive image handling * - Strapi image format support (thumbnail, small, medium, large) * - next/image integration with automatic width/height * - Fallback support for missing images * - Alt text from Strapi alternativeText field * * @example * ```tsx * <StrapiImage * data={page.attributes.hero.image} * nextImageProps={{ * priority: true, * className: 'rounded-lg', * fill: true, * }} * /> * ``` */ export declare function StrapiImage(props: StrapiImageProps): React.ReactElement | null; //# sourceMappingURL=StrapiImage.d.ts.map