import React from "react"; import { Dialog, DialogTitle, DialogContent, DialogActions, Typography, Button, Box, } from "@mui/material"; const EmployeeDetailsModal = ({ open, onClose, employee, type }) => { if (!employee) return null; // دالة لتحويل الحالة الرقمية إلى نصية const getStatusText = (active) => (active ? "Active" : "Inactive"); // عنوان المودال حسب نوع الموظف const getTitle = () => { switch (type?.toLowerCase()) { case "waiter": return "Waiter Details"; case "cooker": return "Cooker Details"; case "accountant": return "Accountant Details"; default: return "Employee Details"; } }; return ( {getTitle()} {employee.name && Name: {employee.name}} {employee.email && Email: {employee.email}} {employee.shift_type && Shift: {employee.shift_type}} {employee.working_hours !== undefined && ( Working Hours: {employee.working_hours} )} {employee.monthly_salary !== undefined && ( Monthly Salary: {employee.monthly_salary} )} {employee.active !== undefined && ( Status: {getStatusText(employee.active)} )} {employee.code && Code: {employee.code}} {employee.expires_at && Expires At: {employee.expires_at}} ); }; export default EmployeeDetailsModal;