@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
17 lines (16 loc) • 827 B
JavaScript
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';
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) => theme.palette.grey[200],
}, ...slotProps.historyContainer },
React.createElement(ChatHistory, null)));
};
export default HistoryContainer;