Skip to content

Commit

Permalink
Create EnhancedSalesDashboard.js
Browse files Browse the repository at this point in the history
  • Loading branch information
tajmahal226 authored Sep 20, 2024
1 parent f435e64 commit b0ab4f7
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions EnhancedSalesDashboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import BDRPerformanceChart from './BDRPerformanceChart.js';
import Leaderboard from './Leaderboard.js';
import SalesPipelineChart from './SalesPipelineChart.js';
import BDRInputForm from './BDRInputForm.js';
import Card from './Card.js';

const EnhancedSalesDashboard = () => {
const [bdrData, setBdrData] = useState([]);
const [pipelineData, setPipelineData] = useState([]);

useEffect(() => {
// Initialize with some mock pipeline data
setPipelineData([
{ name: 'Leads', value: 5000 },
{ name: 'Qualified', value: 3000 },
{ name: 'Proposals', value: 1200 },
{ name: 'Negotiations', value: 600 },
{ name: 'Closed', value: 200 },
]);
}, []);

const handleBDRSubmit = (newData) => {
setBdrData(prevData => {
const existingIndex = prevData.findIndex(bdr => bdr.name === newData.name);
if (existingIndex !== -1) {
// Update existing BDR data
const updatedData = [...prevData];
updatedData[existingIndex] = newData;
return updatedData;
} else {
// Add new BDR data
return [...prevData, newData];
}
});
};

return (
<div>
<Card title="Add/Update BDR Data">
<BDRInputForm onSubmit={handleBDRSubmit} />
</Card>

<Card title="BDR Performance">
<BDRPerformanceChart data={bdrData} />
</Card>

<Card title="BDR Leaderboard">
<Leaderboard data={bdrData} />
</Card>

<Card title="Sales Pipeline">
<SalesPipelineChart data={pipelineData} />
</Card>
</div>
);
};

export default EnhancedSalesDashboard;

0 comments on commit b0ab4f7

Please sign in to comment.