mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 16:43:16 +00:00
35 lines
758 B
TypeScript
35 lines
758 B
TypeScript
import { useEffect, useState } from 'react';
|
|
import Navigation from './components/Navigation/Navigation';
|
|
import DocsGPT from './components/DocsGPT';
|
|
import './App.css';
|
|
|
|
function App() {
|
|
const [isMobile, setIsMobile] = useState(true);
|
|
|
|
const handleResize = () => {
|
|
if (window.innerWidth > 768 && isMobile) {
|
|
setIsMobile(false);
|
|
} else {
|
|
setIsMobile(true);
|
|
}
|
|
};
|
|
|
|
useEffect(() => {
|
|
window.addEventListener('resize', handleResize);
|
|
handleResize();
|
|
|
|
return () => {
|
|
window.removeEventListener('resize', handleResize);
|
|
};
|
|
}, []);
|
|
|
|
return (
|
|
<div className={`${isMobile ? 'flex-col' : 'flex-row'} flex`}>
|
|
<Navigation isMobile={isMobile} />
|
|
<DocsGPT />
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default App;
|