From dbc8c4591485fec3c65fc92de62b476c4f68c533 Mon Sep 17 00:00:00 2001 From: Jason Staack Date: Sat, 21 Mar 2026 16:05:31 -0500 Subject: [PATCH] fix(lint): remove unused imports and variables from redesign Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/src/components/dashboard/EventsTimeline.tsx | 1 - frontend/src/components/dashboard/KpiCards.tsx | 8 -------- frontend/src/components/dashboard/QuickActions.tsx | 1 - frontend/src/components/fleet/FleetDashboard.tsx | 9 --------- .../src/components/simple-config/SimpleModeToggle.tsx | 1 - frontend/src/components/ui/skeleton.tsx | 4 +--- .../tenants/$tenantId/devices/$deviceId.tsx | 7 +------ 7 files changed, 2 insertions(+), 29 deletions(-) diff --git a/frontend/src/components/dashboard/EventsTimeline.tsx b/frontend/src/components/dashboard/EventsTimeline.tsx index 17cb0aa..7ed6c4c 100644 --- a/frontend/src/components/dashboard/EventsTimeline.tsx +++ b/frontend/src/components/dashboard/EventsTimeline.tsx @@ -1,7 +1,6 @@ import { useState } from 'react' import { useQuery } from '@tanstack/react-query' import { Bell, Server, HardDrive } from 'lucide-react' -import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { cn } from '@/lib/utils' import { eventsApi, type DashboardEvent, type EventsParams } from '@/lib/eventsApi' import { DeviceLink } from '@/components/ui/device-link' diff --git a/frontend/src/components/dashboard/KpiCards.tsx b/frontend/src/components/dashboard/KpiCards.tsx index 4931b76..47cd177 100644 --- a/frontend/src/components/dashboard/KpiCards.tsx +++ b/frontend/src/components/dashboard/KpiCards.tsx @@ -1,5 +1,3 @@ -import { Server, Wifi, AlertTriangle, Activity } from 'lucide-react' -import { Card, CardContent } from '@/components/ui/card' import { useAnimatedCounter } from '@/hooks/useAnimatedCounter' import { cn } from '@/lib/utils' @@ -23,7 +21,6 @@ export function formatBandwidth(bps: number): { value: number; unit: string } { } interface KpiCardProps { - icon: React.ReactNode label: string value: number suffix?: string @@ -33,7 +30,6 @@ interface KpiCardProps { } function KpiCard({ - icon, label, value, suffix, @@ -85,13 +81,11 @@ export function KpiCards({ return (
} label="Total Devices" value={totalDevices} colorClass="text-accent" /> } label="Online" value={onlinePercent} suffix="%" @@ -99,14 +93,12 @@ export function KpiCards({ colorClass="text-success" /> } label="Active Alerts" value={activeAlerts} colorClass={activeAlerts > 0 ? 'text-warning' : 'text-text-muted'} highlight={activeAlerts > 0} /> } label="Total Bandwidth" value={bandwidth.value} suffix={bandwidth.unit} diff --git a/frontend/src/components/dashboard/QuickActions.tsx b/frontend/src/components/dashboard/QuickActions.tsx index 12f906c..34a0fbe 100644 --- a/frontend/src/components/dashboard/QuickActions.tsx +++ b/frontend/src/components/dashboard/QuickActions.tsx @@ -7,7 +7,6 @@ import { Bell, Map, } from 'lucide-react' -import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { cn } from '@/lib/utils' export interface QuickActionsProps { diff --git a/frontend/src/components/fleet/FleetDashboard.tsx b/frontend/src/components/fleet/FleetDashboard.tsx index c072d55..866f867 100644 --- a/frontend/src/components/fleet/FleetDashboard.tsx +++ b/frontend/src/components/fleet/FleetDashboard.tsx @@ -208,9 +208,6 @@ export function FleetDashboard() { () => fleetDevices?.filter((d) => d.status === 'online') ?? [], [fleetDevices], ) - const onlinePercent = - totalDevices > 0 ? (onlineDevices.length / totalDevices) * 100 : 0 - const degradedCount = useMemo( () => fleetDevices?.filter((d) => d.status === 'degraded').length ?? 0, [fleetDevices], @@ -255,12 +252,6 @@ export function FleetDashboard() { })) }, [fleetDevices]) - // Total "bandwidth" (sum of CPU loads scaled) - const totalBandwidthBps = useMemo( - () => topConsumers.reduce((sum, d) => sum + d.bandwidthBps, 0), - [topConsumers], - ) - // Last updated timestamp const lastUpdated = dataUpdatedAt ? new Date(dataUpdatedAt).toLocaleTimeString('en-US', { diff --git a/frontend/src/components/simple-config/SimpleModeToggle.tsx b/frontend/src/components/simple-config/SimpleModeToggle.tsx index ce89354..0ee5e10 100644 --- a/frontend/src/components/simple-config/SimpleModeToggle.tsx +++ b/frontend/src/components/simple-config/SimpleModeToggle.tsx @@ -4,7 +4,6 @@ */ import { LayoutGrid, Sliders } from 'lucide-react' -import { Button } from '@/components/ui/button' import { cn } from '@/lib/utils' interface SimpleModeToggleProps { diff --git a/frontend/src/components/ui/skeleton.tsx b/frontend/src/components/ui/skeleton.tsx index 634af0f..9ef4e7a 100644 --- a/frontend/src/components/ui/skeleton.tsx +++ b/frontend/src/components/ui/skeleton.tsx @@ -1,7 +1,5 @@ -import { cn } from '@/lib/utils' - // Compatibility shim — returns null. Remove once all imports are cleaned up. -export function Skeleton({ className: _className }: { className?: string }) { +export function Skeleton() { return null } diff --git a/frontend/src/routes/_authenticated/tenants/$tenantId/devices/$deviceId.tsx b/frontend/src/routes/_authenticated/tenants/$tenantId/devices/$deviceId.tsx index 5e5fda0..0b961d2 100644 --- a/frontend/src/routes/_authenticated/tenants/$tenantId/devices/$deviceId.tsx +++ b/frontend/src/routes/_authenticated/tenants/$tenantId/devices/$deviceId.tsx @@ -17,7 +17,7 @@ import { ShieldOff, Shield, } from 'lucide-react' -import { devicesApi, deviceGroupsApi, deviceTagsApi, tenantsApi, configApi, sitesApi, type DeviceResponse, type DeviceUpdate } from '@/lib/api' +import { devicesApi, deviceGroupsApi, deviceTagsApi, configApi, sitesApi, type DeviceResponse, type DeviceUpdate } from '@/lib/api' import { alertsApi } from '@/lib/alertsApi' import { useAuth, canWrite, canDelete } from '@/lib/auth' import { toast } from '@/components/ui/toast' @@ -315,11 +315,6 @@ function DeviceDetailPage() { queryFn: () => devicesApi.get(tenantId, deviceId), }) - const { data: tenant } = useQuery({ - queryKey: ['tenants', tenantId], - queryFn: () => tenantsApi.get(tenantId), - }) - const { data: backups } = useQuery({ queryKey: ['config-backups', tenantId, deviceId], queryFn: () => configApi.listBackups(tenantId, deviceId),