Skip to main content
Glama

mcp-google-sheets

image-with-fallback.tsx1.57 kB
import React, { useState } from 'react'; import { Skeleton } from '@/components/ui/skeleton'; import { cn } from '@/lib/utils'; interface ImageWithFallbackProps extends React.ImgHTMLAttributes<HTMLImageElement> { fallback?: React.ReactNode; } const ImageWithFallback = ({ src, alt, fallback, ...props }: ImageWithFallbackProps) => { const [hasError, setHasError] = useState(false); const [isLoading, setIsLoading] = useState(true); const handleLoad = () => { setIsLoading(false); }; const handleError = () => { setHasError(true); setIsLoading(false); }; const { className, ...rest } = props; return ( <span className={cn('relative inline-block h-full w-full', className)}> {isLoading && !hasError && ( <span className="absolute inset-0 flex items-center justify-center"> {fallback ?? <Skeleton className="w-full h-full" />} </span> )} {!hasError ? ( <img src={src} alt={alt} onLoad={handleLoad} onError={handleError} className={cn( `transition-opacity duration-500 w-full h-full object-cover`, { 'opacity-0': isLoading, 'opacity-100': !isLoading, }, className, )} {...rest} /> ) : ( <span className="absolute inset-0 flex items-center justify-center"> {fallback ?? <Skeleton className="w-full h-full" />} </span> )} </span> ); }; export default ImageWithFallback;

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/activepieces/activepieces'

If you have feedback or need assistance with the MCP directory API, please join our Discord server