-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
108 lines (98 loc) · 4.12 KB
/
App.js
File metadata and controls
108 lines (98 loc) · 4.12 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import React, { useState } from "react";
import "bootstrap/dist/css/bootstrap.min.css";
function App() {
const [applications, setApplications] = useState([]);
const [company, setCompany] = useState("");
const [position, setPosition] = useState("");
const [status, setStatus] = useState("Applied");
const addApplication = (e) => {
e.preventDefault();
const newApplication = { company, position, status };
setApplications([...applications, newApplication]);
setCompany("");
setPosition("");
setStatus("Applied");
};
return (
<div className="container mt-5">
<h1 className="text-center mb-4">🚀 Job Application Tracker</h1>
{/* Job Application Form */}
<form className="card p-4 shadow-sm" onSubmit={addApplication}>
<div className="mb-3">
<label className="form-label">Company Name</label>
<input
type="text"
className="form-control"
value={company}
onChange={(e) => setCompany(e.target.value)}
required
/>
</div>
<div className="mb-3">
<label className="form-label">Job Position</label>
<input
type="text"
className="form-control"
value={position}
onChange={(e) => setPosition(e.target.value)}
required
/>
</div>
<div className="mb-3">
<label className="form-label">Application Status</label>
<select
className="form-select"
value={status}
onChange={(e) => setStatus(e.target.value)}
>
<option>Applied</option>
<option>Interview</option>
<option>Rejected</option>
</select>
</div>
<button type="submit" className="btn btn-primary w-100">
Add Job Application
</button>
</form>
{/* Job Applications Table */}
<div className="mt-5">
<h2>📋 Tracked Applications</h2>
{applications.length === 0 ? (
<p className="text-muted">No applications added yet.</p>
) : (
<table className="table table-bordered mt-3">
<thead className="table-dark">
<tr>
<th>Company</th>
<th>Position</th>
<th>Status</th>
</tr>
</thead>
<tbody>
{applications.map((app, index) => (
<tr key={index}>
<td>{app.company}</td>
<td>{app.position}</td>
<td>
<span
className={`badge ${
app.status === "Applied"
? "bg-warning"
: app.status === "Interview"
? "bg-success"
: "bg-danger"
}`}
>
{app.status}
</span>
</td>
</tr>
))}
</tbody>
</table>
)}
</div>
</div>
);
}
export default App;