From 1b53a4179aada9bca78f39c696224eb4b3ed2cde Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Mon, 5 Jun 2023 17:15:59 -0700 Subject: [PATCH] feat: Pass deviceIds prop from DeviceTable to useDevices --- src/lib/seam/components/DeviceTable/DeviceTable.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib/seam/components/DeviceTable/DeviceTable.tsx b/src/lib/seam/components/DeviceTable/DeviceTable.tsx index 056443019..64c3fb318 100644 --- a/src/lib/seam/components/DeviceTable/DeviceTable.tsx +++ b/src/lib/seam/components/DeviceTable/DeviceTable.tsx @@ -10,7 +10,6 @@ import { DeviceRow } from 'lib/seam/components/DeviceTable/DeviceRow.js' import { useDevices, type UseDevicesData, - type UseDevicesParams, } from 'lib/seam/devices/use-devices.js' import { ContentHeader } from 'lib/ui/layout/ContentHeader.js' import { EmptyPlaceholder } from 'lib/ui/Table/EmptyPlaceholder.js' @@ -20,18 +19,20 @@ import { TableTitle } from 'lib/ui/Table/TableTitle.js' import { SearchTextField } from 'lib/ui/TextField/SearchTextField.js' import { Caption } from 'lib/ui/typography/Caption.js' -export type DeviceTableProps = Props & UseDevicesParams - -interface Props { +export interface DeviceTableProps { + deviceIds?: string[] onBack?: () => void className?: string } export function DeviceTable({ + deviceIds, onBack, className, }: DeviceTableProps): JSX.Element | null { - const { devices, isLoading, isError, error } = useDevices() + const { devices, isLoading, isError, error } = useDevices({ + device_ids: deviceIds, + }) const [selectedDeviceId, selectDevice] = useState(null) const [searchTerm, setSearchTerm] = useState('')