LibreChat/src/App.jsx

38 lines
1.1 KiB
React
Raw Normal View History

2023-02-07 09:41:54 -05:00
import React from 'react';
import Messages from './components/Messages';
import Landing from './components/Main/Landing';
import TextChat from './components/Main/TextChat';
2023-02-06 13:27:28 -05:00
import Nav from './components/Nav';
import MobileNav from './components/Nav/MobileNav';
2023-02-13 18:02:29 -05:00
import useDocumentTitle from '~/hooks/useDocumentTitle';
import { useSelector } from 'react-redux';
2023-02-04 19:19:53 -05:00
const App = () => {
const { messages } = useSelector((state) => state.messages);
2023-02-13 18:02:29 -05:00
const { title } = useSelector((state) => state.convo);
useDocumentTitle(title);
// bg-color: #343541 instead of bg-gray-800
2023-02-04 19:19:53 -05:00
return (
<div className="flex h-screen">
<Nav />
2023-02-06 13:27:28 -05:00
<div className="flex h-full w-full flex-1 flex-col bg-gray-50 md:pl-[260px]">
<div className="transition-width relative flex h-full w-full flex-1 flex-col items-stretch overflow-hidden bg-white dark:bg-gray-800/90">
<MobileNav />
2023-02-13 18:02:29 -05:00
{messages.length === 0 ? (
<Landing title={title} />
) : (
<Messages
messages={messages}
/>
)}
<TextChat messages={messages} />
</div>
2023-02-04 19:19:53 -05:00
</div>
</div>
);
};
export default App;