import React, { useState } from "react"; import { MapContainer, TileLayer, Marker, Popup } from "react-leaflet"; import { Card, CardContent } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs"; import { LineChart, Line, XAxis, YAxis, Tooltip, ResponsiveContainer } from "recharts"; import { motion } from "framer-motion"; import { PhoneCall, Battery, Zap, MapPin, DollarSign, Shield } from "lucide-react"; // Mock vehicle and grid data const vehicles = [ { id: 1, name: "EV-101", lat: 1.3521, lng: 103.8198, soc: 80, status: "Idle", battery: 60, fleet: false }, { id: 2, name: "EV-202", lat: 1.3621, lng: 103.8298, soc: 45, status: "Discharging", battery: 120, fleet: true }, { id: 3, name: "EV-303", lat: 1.3721, lng: 103.8098, soc: 90, status: "Charging", battery: 75, fleet: false }, ]; const demandCurve = [ { time: "10:00", demand: 120 }, { time: "12:00", demand: 180 }, { time: "14:00", demand: 150 }, { time: "16:00", demand: 200 }, { time: "18:00", demand: 250 }, ]; export default function V2GPlatformUI() { const [selectedEV, setSelectedEV] = useState(null); return (
{v.name}
Status: {v.status}
SoC: {v.soc}%
Battery: {v.battery} kWh
{v.fleet ? "Fleet Vehicle" : "Private EV"}
Status: {selectedEV.status}
State of Charge: {selectedEV.soc}%
Battery Capacity: {selectedEV.battery} kWh
Select a vehicle on the map.
)}EVs closer to demand centers reduce losses, relieve congestion, support renewables, and optimize voltage/frequency regulation.
Larger batteries provide longer dispatch windows and flexibility. Smart scheduling & BMS mitigate ~9–14% extra degradation over 10 years.