use-vibes
Version:
Transform any DOM element into an AI-powered micro-app
44 lines (43 loc) • 1.5 kB
TypeScript
import type { ImageDocument } from '../../hooks/image-gen/types';
import { ImgGenClasses } from '../../utils/style-utils';
export interface ImgGenPlaceholderProps {
className?: string;
alt?: string;
prompt?: string;
progress: number;
/** Whether the component is currently loading */
loading?: boolean;
error?: Error | null;
classes?: ImgGenClasses;
}
export interface ImgGenDisplayProps {
document: ImageDocument & {
_id: string;
};
className?: string;
alt?: string;
/** Callback when delete is confirmed - receives document ID */
onDelete?: (id: string) => void;
/** Callback when regeneration is requested - receives document ID */
onRegen?: (id: string) => void;
/** Callback when prompt is edited - receives document ID and new prompt */
onPromptEdit?: (id: string, newPrompt: string) => void;
/** Custom CSS classes for styling component parts */
classes?: ImgGenClasses;
/** Whether the component is currently loading */
loading: boolean;
/** Generation progress as a number between 0-100 */
progress: number;
/** Error if image generation failed */
error?: Error | null;
/** Enable debug logging */
debug?: boolean;
}
export interface ImgGenErrorProps {
/** Optional error message to display */
message?: string;
/** Optional CSS class name */
className?: string;
/** Custom CSS classes for styling component parts */
classes?: ImgGenClasses;
}