import { useState } from "react"; import { Card, CardContent, Avatar, Typography, Chip, IconButton, Tooltip, Stack, Box, } from "@mui/material"; import { Edit, Delete, Visibility, VpnKey, InfoOutlined, AdminPanelSettings, History, } from "@mui/icons-material"; import EditUser from "./EditUser/EditUser"; import "./User.scss"; import { IUser } from "../Pages/Admin/Users/interfaces"; interface Props { user: IUser; } export default function UserRoleCard({ user }: Props) { const [isEditing, setIsEditing] = useState(false); const { username, first_name, last_name, email, groups } = user; const handleEditClick = () => { setIsEditing(!isEditing); }; return ( {/* Header */} {username?.slice(0, 2).toUpperCase()} {username} {first_name} {last_name} {email} {true && ( } label="Admin" size="small" /> )} {/* Merchants + Roles */} Merchants {/* {merchants.map((m) => ( ))} */} Roles {groups.map(role => ( ))} {/* {extraRolesCount && } */}
{isEditing && }
); }