From e932e6b8178e03acca95bfe5c0fb8654a48c5935 Mon Sep 17 00:00:00 2001 From: sazzadulalambd Date: Sat, 16 May 2026 12:20:18 +0600 Subject: [PATCH] refactor: remove RefreshCw icon and unused BMS refresh functionality from battery detail page --- src/app/admin/batteries/[id]/page.tsx | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/src/app/admin/batteries/[id]/page.tsx b/src/app/admin/batteries/[id]/page.tsx index 50ef70d..468a854 100644 --- a/src/app/admin/batteries/[id]/page.tsx +++ b/src/app/admin/batteries/[id]/page.tsx @@ -4,7 +4,7 @@ import { useState, use } from 'react'; import Link from 'next/link'; import { Battery, ArrowLeft, X, BatteryCharging, Activity, Gauge, MapPin, Bike, User, History, - Calendar, DollarSign, CheckCircle, Clock, ArrowRightLeft, Handshake, TrendingUp, Edit, RefreshCw + Calendar, DollarSign, CheckCircle, Clock, ArrowRightLeft, Handshake, TrendingUp, Edit } from 'lucide-react'; interface BMSData { @@ -127,35 +127,12 @@ export default function BatteryDetailPage({ params }: { params: Promise<{ id: st const [battery, setBattery] = useState(mockBattery); const [activeTab, setActiveTab] = useState<'info' | 'bms' | 'history' | 'rent'>('info'); const [showEditModal, setShowEditModal] = useState(false); - const [refreshing, setRefreshing] = useState(false); const handleSaveEdit = (updatedBattery: Battery) => { setBattery(updatedBattery); setShowEditModal(false); }; - const handleRefreshBMS = () => { - setRefreshing(true); - setTimeout(() => { - setBattery({ - ...battery, - bmsData: { - ...battery.bmsData!, - voltage: Math.round((60 + Math.random() * 10) * 10) / 10, - current: Math.round((-3 + Math.random() * 4) * 10) / 10, - soc: Math.floor(Math.random() * 40) + 60, - temperature: 25 + Math.floor(Math.random() * 15), - cycles: battery.bmsData!.cycles + 1, - health: Math.max(70, Math.min(100, battery.bmsData!.health + (Math.random() > 0.7 ? 1 : 0))), - timestamp: new Date().toISOString().replace('T', ' ').substring(0, 19) - }, - currentSoc: Math.floor(Math.random() * 40) + 60, - health: Math.max(70, Math.min(100, battery.health + (Math.random() > 0.7 ? 1 : 0))) - }); - setRefreshing(false); - }, 1000); - }; - return (
@@ -219,6 +196,7 @@ export default function BatteryDetailPage({ params }: { params: Promise<{ id: st Live BMS Data Real-time +