mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-05-19 16:08:39 -05:00
ba0c89fc6c
Replace custom SVG icons and @mui/icons-material with lucide-react for consistent, lightweight icon management across the application. ## Changes - Add lucide-react package and remove @mui/icons-material - Create theme-aware Icon wrapper component with color resolution - Create iconMap.js for legacy icon name mappings - Migrate 64 components to use new Icon component - Remove 74 unused SVG files from assets/icons/ ## Benefits - Consistent icon API across the application - Smaller bundle size with tree-shakeable imports - Theme-aware color support via MUI theme paths - Simpler maintenance with single icon library
45 lines
957 B
React
45 lines
957 B
React
import Typography from "@mui/material/Typography";
|
|
import DataTable from "@/Components/v1/Table/index.jsx";
|
|
import Icon from "@/Components/v1/Icon";
|
|
|
|
import { useTranslation } from "react-i18next";
|
|
import { ROLES } from "../../../../Utils/roleUtils.js";
|
|
|
|
const RoleTable = ({ roles, handleDeleteRole }) => {
|
|
const { t } = useTranslation();
|
|
const HEADERS = [
|
|
{
|
|
id: "name",
|
|
content: <Typography>{t("editUserPage.table.roleHeader")}</Typography>,
|
|
render: (row) => {
|
|
return row;
|
|
},
|
|
},
|
|
{
|
|
id: "delete",
|
|
content: <Typography>{t("editUserPage.table.actionHeader")}</Typography>,
|
|
render: (row) => {
|
|
if (row === ROLES.SUPERADMIN) return null;
|
|
return (
|
|
<Icon
|
|
name="Trash2"
|
|
size={20}
|
|
onClick={() => {
|
|
handleDeleteRole(row);
|
|
}}
|
|
style={{ cursor: "pointer" }}
|
|
/>
|
|
);
|
|
},
|
|
},
|
|
];
|
|
return (
|
|
<DataTable
|
|
headers={HEADERS}
|
|
data={roles}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default RoleTable;
|