keycloak-scim/src/realm-roles/RealmRolesSection.tsx

28 lines
808 B
TypeScript
Raw Normal View History

import React from "react";
import { PageSection } from "@patternfly/react-core";
import { ViewHeader } from "../components/view-header/ViewHeader";
import { useAdminClient } from "../context/auth/AdminClient";
import { RolesList } from "./RolesList";
export const RealmRolesSection = () => {
const adminClient = useAdminClient();
const loader = async (first?: number, max?: number, search?: string) => {
const params: { [name: string]: string | number } = {
first: first!,
max: max!,
search: search!,
};
2021-03-02 15:27:33 +00:00
const x = await adminClient.roles.find(params);
return x;
};
return (
<>
<ViewHeader titleKey="roles:title" subKey="roles:roleExplain" />
<PageSection variant="light">
<RolesList loader={loader} />
</PageSection>
</>
);
};