import React, { useState } from 'react';
import './App.css';
import Navbar from './Navbar';
import Footer from './Footer';
import EmployeeList from './EmployeeList';
import AddEmployee from './AddEmployee';
import EditEmployee from './EditEmployee';
import DeleteEmployee from './DeleteEmployee';
import LeaveApplication from './LeaveApplication';
import LeaveApproval from './LeaveApproval';
import LeaveBalanceTracking from './LeaveBalanceTracking';
import SalaryCalculation from './SalaryCalculation';
import SalarySlip from './SalarySlip';
import PayrollReports from './PayrollReports';
import LeaveReports from './LeaveReports';
import RoleBasedAccess from './RoleBasedAccess';
import React, { useState } from 'react'; import './App.css'; import Navbar from './Navbar'; import Footer from './Footer'; import EmployeeList from './EmployeeList'; import AddEmployee from './AddEmployee'; import EditEmployee from './EditEmployee'; import DeleteEmployee from './DeleteEmployee'; import LeaveApplication from './LeaveApplication'; import LeaveApproval from './LeaveApproval'; import LeaveBalanceTracking from './LeaveBalanceTracking'; import SalaryCalculation from './SalaryCalculation'; import SalarySlip from './SalarySlip'; import PayrollReports from './PayrollReports'; import LeaveReports from './LeaveReports'; import RoleBasedAccess from './RoleBasedAccess';
import '@fortawesome/fontawesome-free/css/all.min.css';
function App() { const [formData, setFormData] = useState({ userName: '', employeeID: '', department: '', position: '', email: '', contact: '', dailyWage: '', workingDays: '', bonus: '', deductions: '', });
const [salaryInfo, setSalaryInfo] = useState({ name: '', salary: '' });
// Generalized input change handler const handleInputChange = (e) => { const { name, value } = e.target; setFormData({ ...formData,
};
// Function to calculate and show salary const showSalary = () => { const { dailyWage, workingDays, bonus, deductions, userName } = formData; const pay = parseFloat(dailyWage) * parseInt(workingDays, 10); const netSalary = pay + parseFloat(bonus) - parseFloat(deductions); setSalaryInfo({ name:
Employee's Name: ${userName}
, salary:Net Salary: INR ${netSalary.toFixed(2)}
, }); };return (
Payroll Salary Management System
); }
export default App;