Saunak359 commited on
Commit
d25dea0
·
verified ·
1 Parent(s): 813db5a

Update src/App.js

Browse files
Files changed (1) hide show
  1. src/App.js +64 -15
src/App.js CHANGED
@@ -1,25 +1,74 @@
1
- import logo from './logo.svg';
2
- import './App.css';
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  function App() {
 
 
5
  return (
6
- <div className="App">
7
- <header className="App-header">
8
- <img src={logo} className="App-logo" alt="logo" />
9
- <p>
10
- Edit <code>src/App.js</code> and save to reload.
11
- </p>
12
- <a
13
- className="App-link"
14
- href="https://reactjs.org"
15
- target="_blank"
16
- rel="noopener noreferrer"
 
 
17
  >
18
- Learn React
19
- </a>
20
  </header>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  </div>
22
  );
23
  }
24
 
25
  export default App;
 
 
1
+ import { useState } from "react";
2
+ import { motion } from "framer-motion";
3
+ import { Card, CardContent } from "@/components/ui/card";
4
+ import { Button } from "@/components/ui/button";
5
+ import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend } from "recharts";
6
+
7
+ import "./App.css";
8
+
9
+ // Sample chart data
10
+ const data = [
11
+ { name: "Jan", transactions: 4000, frauds: 240 },
12
+ { name: "Feb", transactions: 3000, frauds: 180 },
13
+ { name: "Mar", transactions: 5000, frauds: 350 },
14
+ { name: "Apr", transactions: 4780, frauds: 210 },
15
+ ];
16
 
17
  function App() {
18
+ const [count, setCount] = useState(0);
19
+
20
  return (
21
+ <div className="min-h-screen bg-gradient-to-br from-gray-900 to-gray-800 text-white p-6">
22
+ <header className="flex justify-between items-center mb-8">
23
+ <motion.h1
24
+ initial={{ opacity: 0, y: -20 }}
25
+ animate={{ opacity: 1, y: 0 }}
26
+ transition={{ duration: 0.6 }}
27
+ className="text-3xl font-bold tracking-wide"
28
+ >
29
+ 🚀 Fraud Detection Dashboard
30
+ </motion.h1>
31
+ <Button
32
+ onClick={() => setCount(count + 1)}
33
+ className="rounded-2xl shadow-lg px-4"
34
  >
35
+ Clicks: {count}
36
+ </Button>
37
  </header>
38
+
39
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-6">
40
+ {/* Stats Card */}
41
+ <Card className="rounded-2xl shadow-lg bg-gray-800">
42
+ <CardContent className="p-6">
43
+ <h2 className="text-xl font-semibold mb-2">Overview</h2>
44
+ <p className="text-gray-300">Track fraud vs transactions in real time.</p>
45
+ </CardContent>
46
+ </Card>
47
+
48
+ {/* Chart Card */}
49
+ <Card className="rounded-2xl shadow-lg bg-gray-800">
50
+ <CardContent className="p-6">
51
+ <h2 className="text-xl font-semibold mb-4">Fraud Trends</h2>
52
+ <LineChart
53
+ width={400}
54
+ height={250}
55
+ data={data}
56
+ margin={{ top: 5, right: 30, left: 0, bottom: 5 }}
57
+ >
58
+ <CartesianGrid strokeDasharray="3 3" stroke="#555" />
59
+ <XAxis dataKey="name" stroke="#aaa" />
60
+ <YAxis stroke="#aaa" />
61
+ <Tooltip />
62
+ <Legend />
63
+ <Line type="monotone" dataKey="transactions" stroke="#8884d8" strokeWidth={2} />
64
+ <Line type="monotone" dataKey="frauds" stroke="#ff4d4f" strokeWidth={2} />
65
+ </LineChart>
66
+ </CardContent>
67
+ </Card>
68
+ </div>
69
  </div>
70
  );
71
  }
72
 
73
  export default App;
74
+