@@ -13,14 +13,6 @@ import { Servers24Icon } from '@oxide/design-system/icons/react'
1313import { useQueryTable } from '~/table/QueryTable'
1414import { EmptyMessage } from '~/ui/lib/EmptyMessage'
1515
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-
2416const switchList = getListQFn ( 'switchList' , { } )
2517
2618export async function loader ( ) {
@@ -29,7 +21,7 @@ export async function loader() {
2921}
3022
3123const colHelper = createColumnHelper < Switch > ( )
32- const staticCols = [
24+ const columns = [
3325 colHelper . accessor ( 'id' , { } ) ,
3426 colHelper . accessor ( 'baseboard.part' , { header : 'part number' } ) ,
3527 colHelper . accessor ( 'baseboard.serial' , { header : 'serial number' } ) ,
@@ -38,7 +30,7 @@ const staticCols = [
3830
3931Component . displayName = 'SwitchesTab'
4032export 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 } )
4335 return table
4436}
0 commit comments