@@ -13,6 +13,7 @@ import type { DiskCreate } from '@oxide/api'
1313import { AttachDiskModalForm } from '~/forms/disk-attach'
1414import { CreateDiskSideModalForm } from '~/forms/disk-create'
1515import type { InstanceCreateInput } from '~/forms/instance-create'
16+ import { EmptyCell } from '~/table/cells/EmptyCell'
1617import { Badge } from '~/ui/lib/Badge'
1718import { Button } from '~/ui/lib/Button'
1819import * as MiniTable from '~/ui/lib/MiniTable'
@@ -45,18 +46,18 @@ export function DisksTableField({
4546
4647 return (
4748 < >
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 ) => (
6061 < MiniTable . Row
6162 tabIndex = { 0 }
6263 aria-rowindex = { index + 1 }
@@ -67,15 +68,15 @@ export function DisksTableField({
6768 < Truncate text = { item . name } maxLength = { 35 } />
6869 </ MiniTable . Cell >
6970 < MiniTable . Cell >
70- < Badge variant = "solid" > { item . type } </ Badge >
71+ < Badge > { item . type } </ Badge >
7172 </ MiniTable . Cell >
7273 < MiniTable . Cell >
7374 { item . type === 'attach' ? (
74- '—'
75+ < EmptyCell />
7576 ) : (
7677 < >
7778 < 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 >
7980 </ >
8081 ) }
8182 </ MiniTable . Cell >
@@ -84,17 +85,23 @@ export function DisksTableField({
8485 label = { `remove disk ${ item . name } ` }
8586 />
8687 </ 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 >
9198
9299 < div className = "space-x-3" >
93100 < Button size = "sm" onClick = { ( ) => setShowDiskCreate ( true ) } disabled = { disabled } >
94101 Create new disk
95102 </ Button >
96103 < Button
97- variant = "ghost "
104+ variant = "secondary "
98105 size = "sm"
99106 onClick = { ( ) => setShowDiskAttach ( true ) }
100107 disabled = { disabled }
0 commit comments