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

18 lines (17 loc) 799 B
import * as React from 'react'; import TableCell from '@mui/material/TableCell'; import { styled } from '@mui/material/styles'; import Box from '@mui/material/Box'; import Typography from '@mui/material/Typography'; const BoxStyled = styled(Box)(() => ({ minWidth: 100, overflowY: 'hidden', whiteSpace: 'nowrap', })); const MessageMarkdownTableCell = ({ children, textComponent, textComponentProps, ...otherProps }) => { const comp = { textComponent: textComponent ?? Typography, textComponentProps }; return (React.createElement(TableCell, { size: "small", ...otherProps }, React.createElement(BoxStyled, null, React.createElement(comp.textComponent, { ...comp.textComponentProps }, children)))); }; export default MessageMarkdownTableCell;