Spaces:
Running
Running
File size: 2,124 Bytes
a985b94 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | import React, { useState } from 'react';
import './index.css';
import { HistoricalAnalytics } from './components/HistoricalAnalytics.jsx';
import { MaterialPredictor } from './components/MaterialPredictor.jsx';
import { ChatBot } from './components/ChatBot.jsx';
import logo from '../Assets/g.png';
import thumpVideo from '../Assets/Gorilla_Chest_Thumping_Animation_Generated.mp4';
function App() {
const [activeTab, setActiveTab] = useState('waste');
const [showChat, setShowChat] = useState(false);
const [showVideo, setShowVideo] = useState(false);
const handleGorillaClick = () => {
setShowVideo(true);
setShowChat(false);
};
return (
<>
<div className="dashboard-header">
<div className="header-title-container">
<img
src={logo}
alt="Gorilla Semiconductors Logo"
className="gorilla-logo"
onClick={handleGorillaClick}
/>
<h1 className="header-title">Gorilla Semiconductors</h1>
</div>
</div>
<div className="tabs-container">
<button
className={`tab-btn ${activeTab === 'waste' ? 'active' : ''}`}
onClick={() => setActiveTab('waste')}
>
Historical Waste Analysis
</button>
<button
className={`tab-btn ${activeTab === 'predict' ? 'active' : ''}`}
onClick={() => setActiveTab('predict')}
>
Material Prediction
</button>
</div>
<div style={{ flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column' }}>
{activeTab === 'waste' ? <HistoricalAnalytics /> : <MaterialPredictor />}
</div>
<ChatBot isOpen={showChat} onClose={() => setShowChat(false)} />
{showVideo && (
<div className="thump-video-overlay" onClick={() => { setShowVideo(false); setShowChat(true); }}>
<video
src={thumpVideo}
autoPlay
className="thump-video"
onEnded={() => { setShowVideo(false); setShowChat(true); }}
/>
</div>
)}
</>
);
}
export default App;
|