/* eslint-disable */ // @ts-nocheck import { Button, PageSection, Popover } from "../../shared/@patternfly/react-core"; import { QuestionCircleIcon } from "../../shared/@patternfly/react-icons"; import { useTranslation } from "react-i18next"; import { useNavigate } from "react-router-dom"; import { useHelp } from "../../shared/keycloak-ui-shared"; import { useAdminClient } from "../admin-client"; import type { ClientRoleParams } from "../clients/routes/ClientRole"; import { ListEmptyState } from "../../shared/keycloak-ui-shared"; import { KeycloakDataTable } from "../../shared/keycloak-ui-shared"; import { useRealm } from "../context/realm-context/RealmContext"; import { emptyFormatter, upperCaseFormatter } from "../util"; import { useParams } from "../utils/useParams"; export const UsersInRoleTab = () => { const { adminClient } = useAdminClient(); const navigate = useNavigate(); const { realm } = useRealm(); const { t } = useTranslation(); const { id, clientId } = useParams(); const loader = async (first?: number, max?: number) => { const role = await adminClient.roles.findOneById({ id: id }); if (!role) { throw new Error(t("notFound")); } if (role.clientRole) { return adminClient.clients.findUsersWithRole({ roleName: role.name!, id: clientId, briefRepresentation: true, first, max, }); } return adminClient.roles.findUsersWithRole({ name: role.name!, briefRepresentation: true, first, max, }); }; const { enabled } = useHelp(); return ( {t("whoWillAppearPopoverTextRoles")} {t("or")} } footerContent={t("whoWillAppearPopoverFooterText")} > ) } emptyState={ {t("noUsersEmptyStateDescription")} {t("or")} {t("noUsersEmptyStateDescriptionContinued")} } /> } columns={[ { name: "username", displayKey: "userName", cellFormatters: [emptyFormatter()], }, { name: "email", displayKey: "email", cellFormatters: [emptyFormatter()], }, { name: "lastName", displayKey: "lastName", cellFormatters: [emptyFormatter()], }, { name: "firstName", displayKey: "firstName", cellFormatters: [upperCaseFormatter(), emptyFormatter()], }, ]} /> ); };