@@ -13,6 +13,7 @@ import type { DiskCreate } from '@oxide/api'
13
13
import { AttachDiskModalForm } from '~/forms/disk-attach'
14
14
import { CreateDiskSideModalForm } from '~/forms/disk-create'
15
15
import type { InstanceCreateInput } from '~/forms/instance-create'
16
+ import { EmptyCell } from '~/table/cells/EmptyCell'
16
17
import { Badge } from '~/ui/lib/Badge'
17
18
import { Button } from '~/ui/lib/Button'
18
19
import * as MiniTable from '~/ui/lib/MiniTable'
@@ -45,18 +46,18 @@ export function DisksTableField({
45
46
46
47
return (
47
48
< >
48
- < div className = "max-w-lg" >
49
- { ! ! items . length && (
50
- < MiniTable . Table className = "mb-4" aria-label = "Disks" >
51
- < MiniTable . Header >
52
- < MiniTable . HeadCell > Name </ MiniTable . HeadCell >
53
- < MiniTable . HeadCell > Type </ MiniTable . HeadCell >
54
- < MiniTable . HeadCell > Size </ MiniTable . HeadCell >
55
- { /* For remove button */ }
56
- < MiniTable . HeadCell className = "w-12" / >
57
- </ MiniTable . Header >
58
- < MiniTable . Body >
59
- { items . map ( ( item , index ) => (
49
+ < div className = "flex max-w-lg flex-col items-end gap-3 " >
50
+ < MiniTable . Table aria-label = "Disks" >
51
+ < MiniTable . Header >
52
+ < MiniTable . HeadCell > Name </ MiniTable . HeadCell >
53
+ < MiniTable . HeadCell > Type </ MiniTable . HeadCell >
54
+ < MiniTable . HeadCell > Size </ MiniTable . HeadCell >
55
+ { /* For remove button */ }
56
+ < MiniTable . HeadCell />
57
+ </ MiniTable . Header >
58
+ < MiniTable . Body >
59
+ { items . length ? (
60
+ items . map ( ( item , index ) => (
60
61
< MiniTable . Row
61
62
tabIndex = { 0 }
62
63
aria-rowindex = { index + 1 }
@@ -67,15 +68,15 @@ export function DisksTableField({
67
68
< Truncate text = { item . name } maxLength = { 35 } />
68
69
</ MiniTable . Cell >
69
70
< MiniTable . Cell >
70
- < Badge variant = "solid" > { item . type } </ Badge >
71
+ < Badge > { item . type } </ Badge >
71
72
</ MiniTable . Cell >
72
73
< MiniTable . Cell >
73
74
{ item . type === 'attach' ? (
74
- '—'
75
+ < EmptyCell />
75
76
) : (
76
77
< >
77
78
< span > { bytesToGiB ( item . size ) } </ span >
78
- < span className = "ml-1 inline-block text-accent-secondary " > GiB</ span >
79
+ < span className = "ml-1 inline-block text-tertiary " > GiB</ span >
79
80
</ >
80
81
) }
81
82
</ MiniTable . Cell >
@@ -84,17 +85,23 @@ export function DisksTableField({
84
85
label = { `remove disk ${ item . name } ` }
85
86
/>
86
87
</ MiniTable . Row >
87
- ) ) }
88
- </ MiniTable . Body >
89
- </ MiniTable . Table >
90
- ) }
88
+ ) )
89
+ ) : (
90
+ < MiniTable . EmptyState
91
+ title = "No disks"
92
+ body = "Add a disk to see it here"
93
+ colSpan = { 4 }
94
+ />
95
+ ) }
96
+ </ MiniTable . Body >
97
+ </ MiniTable . Table >
91
98
92
99
< div className = "space-x-3" >
93
100
< Button size = "sm" onClick = { ( ) => setShowDiskCreate ( true ) } disabled = { disabled } >
94
101
Create new disk
95
102
</ Button >
96
103
< Button
97
- variant = "ghost "
104
+ variant = "secondary "
98
105
size = "sm"
99
106
onClick = { ( ) => setShowDiskAttach ( true ) }
100
107
disabled = { disabled }
0 commit comments