diff --git a/frontend/src/components/fleet/AddDeviceForm.tsx b/frontend/src/components/fleet/AddDeviceForm.tsx index eb475b7..7136e5e 100644 --- a/frontend/src/components/fleet/AddDeviceForm.tsx +++ b/frontend/src/components/fleet/AddDeviceForm.tsx @@ -6,7 +6,6 @@ import { vpnApi, credentialProfilesApi, type CredentialProfileResponse, - type ProfileTestResponse, } from '@/lib/api' import { toast } from '@/components/ui/toast' import { Button } from '@/components/ui/button' @@ -58,8 +57,6 @@ export function AddDeviceForm({ tenantId, open, onClose }: Props) { const [showSnmpBulk, setShowSnmpBulk] = useState(false) const [snmpIp, setSnmpIp] = useState('') const [snmpCredProfileId, setSnmpCredProfileId] = useState('') - const [snmpDiscoverResult, setSnmpDiscoverResult] = useState(null) - // Shared state const [error, setError] = useState(null) const [connectionStatus, setConnectionStatus] = useState('idle') diff --git a/frontend/src/components/fleet/FleetTable.tsx b/frontend/src/components/fleet/FleetTable.tsx index 17394c6..cce385f 100644 --- a/frontend/src/components/fleet/FleetTable.tsx +++ b/frontend/src/components/fleet/FleetTable.tsx @@ -208,12 +208,12 @@ export function FleetTable({ updateSearch({ sort_by: col, sort_dir: newDir, page: 1 }) } - const handleDeviceClick = (device: DeviceResponse) => { + const handleDeviceClick = useCallback((device: DeviceResponse) => { void navigate({ to: '/tenants/$tenantId/devices/$deviceId', params: { tenantId, deviceId: device.id }, }) - } + }, [navigate, tenantId]) const totalPages = data ? Math.ceil(data.total / data.page_size) : 0 const startItem = data ? (data.page - 1) * data.page_size + 1 : 0 @@ -247,7 +247,7 @@ export function FleetTable({ if (selectedIndex >= 0 && selectedIndex < items.length) { handleDeviceClick(items[selectedIndex]) } - }, [selectedIndex, items]), + }, [selectedIndex, items, handleDeviceClick]), hasItems && selectedIndex >= 0, )