-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathAccessEmptyState.tsx
More file actions
31 lines (28 loc) · 1.04 KB
/
AccessEmptyState.tsx
File metadata and controls
31 lines (28 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* Copyright Oxide Computer Company
*/
import type { RoleSource } from '@oxide/api'
import { Access24Icon } from '@oxide/design-system/icons/react'
import { EmptyMessage } from '~/ui/lib/EmptyMessage'
import { TableEmptyBox } from '~/ui/lib/Table'
import { identityFilterLabel, type IdentityFilter } from '~/util/access'
type AccessEmptyStateProps = {
onClick: () => void
scope: RoleSource
filter: IdentityFilter
}
export const AccessEmptyState = ({ onClick, scope, filter }: AccessEmptyStateProps) => (
<TableEmptyBox>
<EmptyMessage
icon={<Access24Icon />}
title={`No authorized ${filter === 'all' ? 'users or groups' : filter}`}
body={`Give permission to view, edit, or administer this ${scope}`}
buttonText={`Add ${identityFilterLabel[filter]} to ${scope}`}
onClick={onClick}
/>
</TableEmptyBox>
)