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

19 lines (18 loc) 937 B
import * as React from 'react'; import { useHistoryContext } from '../core/history/HistoryContext'; import ChatHistory from './ChatHistory'; import { useTablet } from '../../ui/Responsive'; import clsx from 'clsx'; import { historyClassNames } from '../core/history/historyClassNames'; import { getSurfaceColor } from "../utils/colors"; const HistoryContainer = ({ className }) => { const { slots, slotProps } = useHistoryContext(); const isTablet = useTablet(); return (React.createElement(slots.historyContainer, { width: "100%", height: "100%", className: clsx(historyClassNames.container, className), sx: { maxWidth: isTablet ? 220 : 360, backgroundColor: (theme) => getSurfaceColor(theme), color: (theme) => theme.palette.text.primary, }, ...slotProps.historyContainer }, React.createElement(ChatHistory, null))); }; export default HistoryContainer;