-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathIpPoolDetailSideModal.tsx
More file actions
51 lines (48 loc) · 1.81 KB
/
IpPoolDetailSideModal.tsx
File metadata and controls
51 lines (48 loc) · 1.81 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
* 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 IpPool } from '@oxide/api'
import { IpGlobal16Icon } from '@oxide/design-system/icons/react'
import { Badge } from '@oxide/design-system/ui'
import { ReadOnlySideModalForm } from '~/components/form/ReadOnlySideModalForm'
import { IpVersionBadge } from '~/components/IpVersionBadge'
import { SideModalFormDocs } from '~/ui/lib/ModalLinks'
import { PropertiesTable } from '~/ui/lib/PropertiesTable'
import { ResourceLabel } from '~/ui/lib/SideModal'
import { docLinks } from '~/util/links'
type IpPoolDetailSideModalProps = {
pool: IpPool
onDismiss: () => void
}
export function IpPoolDetailSideModal({ pool, onDismiss }: IpPoolDetailSideModalProps) {
return (
<ReadOnlySideModalForm
title="IP pool details"
onDismiss={onDismiss}
animate
subtitle={
<ResourceLabel>
<IpGlobal16Icon /> {pool.name}
</ResourceLabel>
}
>
<PropertiesTable>
<PropertiesTable.IdRow id={pool.id} />
<PropertiesTable.DescriptionRow description={pool.description} sideModal />
<PropertiesTable.Row label="IP version">
<IpVersionBadge ipVersion={pool.ipVersion} />
</PropertiesTable.Row>
<PropertiesTable.Row label="Type">
<Badge color="neutral">{pool.poolType}</Badge>
</PropertiesTable.Row>
<PropertiesTable.DateRow label="Created" date={pool.timeCreated} />
<PropertiesTable.DateRow label="Last Modified" date={pool.timeModified} />
</PropertiesTable>
<SideModalFormDocs docs={[docLinks.systemIpPools]} />
</ReadOnlySideModalForm>
)
}