import type { ReactNode } from 'react'; import type { CustomWorldCoverRenderMode } from '../services/customWorldCover'; import { ResolvedAssetImage } from './ResolvedAssetImage'; const COVER_PORTRAIT_CLASS_NAMES = [ 'h-[54%] w-[24%] translate-y-[8%]', 'h-[68%] w-[30%]', 'h-[56%] w-[24%] translate-y-[10%]', ] as const; type CustomWorldCoverArtworkProps = { imageSrc?: string | null; fallbackImageSrc?: string | null; title: string; fallbackLabel: string; renderMode?: CustomWorldCoverRenderMode; characterImageSrcs?: string[]; className?: string; overlay?: ReactNode; }; export function CustomWorldCoverArtwork({ imageSrc, fallbackImageSrc, title, fallbackLabel, renderMode = 'image', characterImageSrcs = [], className = '', overlay, }: CustomWorldCoverArtworkProps) { const coverCharacterImageSrcs = characterImageSrcs.slice(0, 3); return (
{imageSrc || fallbackImageSrc ? ( ) : null}
{!imageSrc && !fallbackImageSrc ? (
{fallbackLabel}
) : null} {renderMode === 'scene_with_roles' && coverCharacterImageSrcs.length > 0 ? ( <>
{coverCharacterImageSrcs.map((characterImageSrc, index) => (
))}
) : null} {overlay ? (
{overlay}
) : null}
); } export default CustomWorldCoverArtwork;