Merge branch 'pramod_Enhancement#86_plannedDisplayInReport' of https://git.marcoaiot.com/admin/marco.pms.web into pramod_Enhancement#86_plannedDisplayInReport

This commit is contained in:
Vikas Nale 2025-04-17 16:27:07 +05:30
commit 83b6c2a307
3 changed files with 20 additions and 20 deletions

View File

@ -7,7 +7,9 @@ const EmployeeNav = ({ onPillClick, activePill }) => {
<ul className="nav nav-tabs">
<li className="nav-item">
<a
className={`nav-link ${activePill === "account" ? "active" : ""}`}
className={`nav-link py-1 px-2 small ${
activePill === "account" ? "active" : ""
}`}
href="#"
onClick={(e) => {
e.preventDefault(); // Prevent page reload

View File

@ -95,7 +95,6 @@ const ManageRole = ({ employeeId, onClosed }) => {
setIsLoading(false);
};
return (
<div
className={`modal fade `}

View File

@ -1,21 +1,22 @@
import React, { useState, useEffect } from "react";
// A simple hash function to generate a deterministic value from the name
function hashString(str) {
let hash = 0;
for (let i = 0; i < str.length; i++) {
const char = str.charCodeAt(i);
hash = (hash << 5) - hash + char;
}
return hash;
}
const Avatar = ({ firstName, lastName, size = "sm" }) => {
// Combine firstName and lastName to create a unique string for hashing
const fullName = `${firstName} ${lastName}`;
const [bgClass, setBgClass] = useState("");
// A simple hash function to generate a deterministic value from the name
function hashString(str) {
let hash = 0;
for (let i = 0; i < str.length; i++) {
const char = str.charCodeAt(i);
hash = (hash << 5) - hash + char;
}
return hash;
}
// Function to generate the avatar text
function generateAvatarText(firstName, lastName) {
if (!firstName) return "";
if (!lastName || lastName.trim() === "") {
@ -49,15 +50,13 @@ const Avatar = ({ firstName, lastName, size = "sm" }) => {
}, [fullName]); // Re-run if the fullName changes
return (
<>
<div className="avatar-wrapper p-1">
<div className={`avatar avatar-${size} me-2`}>
<span className={`avatar-initial rounded-circle ${bgClass}`}>
{generateAvatarText(firstName, lastName)}
</span>
</div>
<div className="avatar-wrapper p-1">
<div className={`avatar avatar-${size} me-2`}>
<span className={`avatar-initial rounded-circle ${bgClass}`}>
{generateAvatarText(firstName, lastName)}
</span>
</div>
</>
</div>
);
};