@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
27 lines (26 loc) • 876 B
JavaScript
import * as React from 'react';
import { createTheme, ThemeProvider } from '@mui/material/styles';
import { createBreakpoints } from '@mui/system';
import createCache from '@emotion/cache';
import { CacheProvider } from '@emotion/react';
const theme = createTheme({
breakpoints: createBreakpoints({
values: {
xs: 0,
sm: 650,
md: 900,
lg: 1200,
xl: 1536,
},
}),
});
const ChatTheme = ({ children }) => {
const emotionCache = React.useMemo(() => {
const cache = createCache({ key: 'css', prepend: true });
cache.compat = true;
return cache;
}, []);
return (React.createElement(CacheProvider, { value: emotionCache },
React.createElement(ThemeProvider, { theme: theme }, children)));
};
export default React.memo(ChatTheme);