UNPKG

@plteam/chat-ui

Version:

CUI Kit is a free and open-source library for creating AI assistant chat interfaces, built with React, Material UI, and TypeScript

9 lines (8 loc) 596 B
import * as React from 'react'; import clsx from 'clsx'; import { markdownComponentsMemoCallback } from './markdownComponentsMemoCallback'; import { chatClassNames } from '../../../core/chatClassNames'; const MarkdownLazyComponentSmoother = ({ componentProps, inProgress, children, ...otherProps }) => { return (React.createElement(otherProps.component, { ...componentProps, className: clsx(componentProps?.className, { [chatClassNames.markdownSmoothedPending]: inProgress }) }, children)); }; export default React.memo(MarkdownLazyComponentSmoother, markdownComponentsMemoCallback);