feat(web): charge point details page

This commit is contained in:
2026-03-10 16:12:38 +08:00
parent 08cd00c802
commit f803a447b5
5 changed files with 654 additions and 10 deletions

View File

@@ -3,6 +3,7 @@
import { useCallback, useEffect, useRef, useState } from "react";
import { Button, Chip, Input, Label, ListBox, Modal, Select, Spinner, Table, TextField } from "@heroui/react";
import { Plus, Pencil, PlugConnection, TrashBin } from "@gravity-ui/icons";
import Link from "next/link";
import { api, type ChargePoint } from "@/lib/api";
@@ -273,8 +274,13 @@ export default function ChargePointsPage() {
)}
{chargePoints.map((cp) => (
<Table.Row key={cp.id} id={String(cp.id)}>
<Table.Cell className="font-mono font-medium">
{cp.chargePointIdentifier}
<Table.Cell>
<Link
href={`/dashboard/charge-points/${cp.id}`}
className="font-mono font-medium text-accent hover:underline"
>
{cp.chargePointIdentifier}
</Link>
</Table.Cell>
<Table.Cell>
{cp.chargePointVendor && cp.chargePointModel ? (
@@ -331,7 +337,7 @@ export default function ChargePointsPage() {
statusDotClass[conn.status] ?? "bg-warning"
}`}
/>
<span className="text-xs text-foreground">
<span className="text-xs text-foreground text-nowrap">
{statusLabelMap[conn.status] ?? conn.status}
</span>
</div>