@@ -3,6 +3,7 @@ import { useNavigate } from 'react-router-dom'
33import { Link } from 'react-router-dom'
44
55import type { Snapshot } from '@oxide/api'
6+ import { useApiQuery } from '@oxide/api'
67import { apiQueryClient , useApiMutation , useApiQueryClient } from '@oxide/api'
78import type { MenuAction } from '@oxide/table'
89import { DateCell , SizeCell , useQueryTable } from '@oxide/table'
@@ -15,10 +16,17 @@ import {
1516 buttonStyle ,
1617} from '@oxide/ui'
1718
19+ import { SnapshotStatusBadge } from 'app/components/StatusBadge'
1820import { CreateSnapshotSideModalForm } from 'app/forms/snapshot-create'
1921import { requireProjectParams , useProjectParams , useRequiredParams } from 'app/hooks'
2022import { pb } from 'app/util/path-builder'
2123
24+ const DiskNameFromId = ( { value } : { value : string } ) => {
25+ const { data : disk } = useApiQuery ( 'diskViewById' , { id : value } )
26+ if ( ! disk ) return null
27+ return < > { disk . name } </ >
28+ }
29+
2230const EmptyState = ( ) => (
2331 < EmptyMessage
2432 icon = { < Snapshots24Icon /> }
@@ -78,6 +86,11 @@ export function SnapshotsPage({ modal }: SnapshotsPageProps) {
7886 < Table emptyState = { < EmptyState /> } makeActions = { makeActions } >
7987 < Column accessor = "name" />
8088 < Column accessor = "description" />
89+ < Column id = "disk" accessor = "diskId" cell = { DiskNameFromId } />
90+ < Column
91+ accessor = "state"
92+ cell = { ( { value } ) => < SnapshotStatusBadge status = { value } /> }
93+ />
8194 < Column accessor = "size" cell = { SizeCell } />
8295 < Column accessor = "timeCreated" cell = { DateCell } />
8396 </ Table >
0 commit comments