Skip to main content
Glama
ChatBumble.tsx1.03 kB
import { MarkdownRenderer } from '@intlayer/design-system'; import { cn } from '@utils/cn'; import { useTheme } from 'next-themes'; import type { FC, HTMLAttributes } from 'react'; export enum ChatBumbleType { QUESTION = 'question', ANSWER = 'answer', } type ChatBumbleProps = Omit<HTMLAttributes<HTMLSpanElement>, 'children'> & { type: ChatBumbleType; children: string; }; export const ChatBumble: FC<ChatBumbleProps> = ({ children, type, ...props }) => { const { resolvedTheme } = useTheme(); return ( <div className={cn( type === ChatBumbleType.QUESTION && 'mr-4 ml-auto w-auto max-w-[90%] whitespace-pre-wrap rounded-xl rounded-tr-none bg-text/95 px-8 py-2 text-text-opposite', type === ChatBumbleType.ANSWER && 'w-full px-4' )} {...props} > {type === ChatBumbleType.ANSWER ? ( <MarkdownRenderer isDarkMode={resolvedTheme === 'dark'}> {children} </MarkdownRenderer> ) : ( children )} </div> ); };

Latest Blog Posts

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/aymericzip/intlayer'

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