Skip to content

Commit 1b10a76

Browse files
committed
chore: cleanup
1 parent af142e3 commit 1b10a76

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

site/src/pages/ManagementSettingsPage/CustomRolesPage/PermissionPillsList.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { type Interpolation, type Theme, useTheme } from "@emotion/react";
22
import Stack from "@mui/material/Stack";
3-
import type { Permission, Role } from "api/typesGenerated";
3+
import type { Permission } from "api/typesGenerated";
44
import { Pill } from "components/Pill/Pill";
55
import {
66
Popover,
@@ -21,7 +21,7 @@ interface PermissionPillsListProps {
2121
export const PermissionPillsList: FC<PermissionPillsListProps> = ({
2222
permissions,
2323
}) => {
24-
const resourceTypes: string[] = getUniqueResourceTypes(permissions);
24+
const resourceTypes = getUniqueResourceTypes(permissions);
2525

2626
return (
2727
<Stack direction="row" spacing={1}>
@@ -53,11 +53,9 @@ const PermissionsPill: FC<PermissionPillProps> = ({
5353
resource,
5454
permissions,
5555
}) => {
56-
const actions = permissions.filter((p) => {
57-
if (resource === p.resource_type) {
58-
return p.action;
59-
}
60-
});
56+
const actions = permissions.filter(
57+
(p) => resource === p.resource_type && p.action,
58+
);
6159

6260
return (
6361
<Pill css={styles.permissionPill}>

0 commit comments

Comments
 (0)