@@ -13,14 +13,6 @@ import { Servers24Icon } from '@oxide/design-system/icons/react'
13
13
import { useQueryTable } from '~/table/QueryTable'
14
14
import { EmptyMessage } from '~/ui/lib/EmptyMessage'
15
15
16
- const EmptyState = ( ) => (
17
- < EmptyMessage
18
- icon = { < Servers24Icon /> }
19
- title = "Something went wrong"
20
- body = "We expected some switches here, but none were found"
21
- />
22
- )
23
-
24
16
const switchList = getListQFn ( 'switchList' , { } )
25
17
26
18
export async function loader ( ) {
@@ -29,7 +21,7 @@ export async function loader() {
29
21
}
30
22
31
23
const colHelper = createColumnHelper < Switch > ( )
32
- const staticCols = [
24
+ const columns = [
33
25
colHelper . accessor ( 'id' , { } ) ,
34
26
colHelper . accessor ( 'baseboard.part' , { header : 'part number' } ) ,
35
27
colHelper . accessor ( 'baseboard.serial' , { header : 'serial number' } ) ,
@@ -38,7 +30,7 @@ const staticCols = [
38
30
39
31
Component . displayName = 'SwitchesTab'
40
32
export function Component ( ) {
41
- const emptyState = < EmptyState />
42
- const { table } = useQueryTable ( { query : switchList , columns : staticCols , emptyState } )
33
+ const emptyState = < EmptyMessage icon = { < Servers24Icon /> } title = "No switches found" />
34
+ const { table } = useQueryTable ( { query : switchList , columns, emptyState } )
43
35
return table
44
36
}
0 commit comments