feat(sidebar): update icons for navigation and charge items
This commit is contained in:
@@ -20,6 +20,7 @@ import { ArrowLeft, Pencil, PlugConnection, ArrowRotateRight } from "@gravity-ui
|
||||
import { api } from "@/lib/api";
|
||||
import { useSession } from "@/lib/auth-client";
|
||||
import dayjs from "@/lib/dayjs";
|
||||
import { Plug } from "lucide-react";
|
||||
|
||||
// ── Status maps ────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -418,7 +419,7 @@ export default function ChargePointDetailPage({ params }: { params: Promise<{ id
|
||||
className="flex min-w-40 flex-col gap-2 rounded-xl border border-border bg-surface p-3"
|
||||
>
|
||||
<div className="flex items-center gap-2">
|
||||
<PlugConnection className="size-4 shrink-0 text-muted" />
|
||||
<Plug className="size-4 shrink-0 text-muted" />
|
||||
<span className="text-sm font-medium text-foreground">
|
||||
接口 #{conn.connectorId}
|
||||
</span>
|
||||
|
||||
@@ -26,6 +26,7 @@ import {
|
||||
type ChartRange,
|
||||
type ChartDataPoint,
|
||||
} from "@/lib/api";
|
||||
import { BanknoteArrowDown, EvCharger, Plug, Users } from "lucide-react";
|
||||
|
||||
// ── Helpers ────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -259,7 +260,7 @@ function TrendChart() {
|
||||
showXAxis={true}
|
||||
curveType="monotone"
|
||||
showAnimation
|
||||
className="h-56"
|
||||
className="h-56 text-sm"
|
||||
/>
|
||||
)}
|
||||
{/* Legend */}
|
||||
@@ -310,7 +311,9 @@ function RecentTransactions({ txns }: { txns: Transaction[] }) {
|
||||
<span
|
||||
className={`flex size-7 shrink-0 items-center justify-center rounded-full ${active ? "bg-warning-soft" : "bg-success/10"}`}
|
||||
>
|
||||
<Thunderbolt className={`size-3.5 ${active ? "text-warning" : "text-success"}`} />
|
||||
<BanknoteArrowDown
|
||||
className={`size-3.5 ${active ? "text-warning" : "text-success"}`}
|
||||
/>
|
||||
</span>
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className="truncate text-sm font-medium text-foreground">
|
||||
@@ -404,7 +407,7 @@ function ChargePointStatus({ cps }: { cps: ChargePoint[] }) {
|
||||
</div>
|
||||
)}
|
||||
<div className="flex items-center gap-1">
|
||||
<PlugConnection className="size-3 text-accent" />
|
||||
<Plug className="size-3 text-accent" />
|
||||
<span className="text-muted">{availableCount}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -531,7 +534,7 @@ export default function DashboardPage() {
|
||||
<StatCard
|
||||
title="充电桩总数"
|
||||
value={s?.totalChargePoints ?? "—"}
|
||||
icon={PlugConnection}
|
||||
icon={EvCharger}
|
||||
color="default"
|
||||
footer={
|
||||
<>
|
||||
@@ -552,7 +555,7 @@ export default function DashboardPage() {
|
||||
<StatCard
|
||||
title="注册用户"
|
||||
value={s?.totalUsers ?? "—"}
|
||||
icon={Person}
|
||||
icon={Users}
|
||||
color="default"
|
||||
footer={<span>系统用户总数</span>}
|
||||
/>
|
||||
|
||||
@@ -17,23 +17,24 @@ import {
|
||||
} from "@gravity-ui/icons";
|
||||
import SidebarFooter from "@/components/sidebar-footer";
|
||||
import { useSession } from "@/lib/auth-client";
|
||||
import { EvCharger, Gauge, ReceiptText, UserCog, Users } from "lucide-react";
|
||||
|
||||
const chargeItems = [
|
||||
{ href: "/dashboard/charge", label: "立即充电", icon: ThunderboltFill, adminOnly: false },
|
||||
{ href: "/dashboard/charge", label: "立即充电", icon: Thunderbolt, adminOnly: false },
|
||||
{ href: "/dashboard/pricing", label: "电价标准", icon: TagDollar, adminOnly: false },
|
||||
];
|
||||
|
||||
const navItems = [
|
||||
{ href: "/dashboard", label: "概览", icon: Thunderbolt, exact: true, adminOnly: false },
|
||||
{ href: "/dashboard/charge-points", label: "充电桩", icon: PlugConnection, adminOnly: false },
|
||||
{ href: "/dashboard", label: "概览", icon: Gauge, exact: true, adminOnly: false },
|
||||
{ href: "/dashboard/charge-points", label: "充电桩", icon: EvCharger, adminOnly: false },
|
||||
{ href: "/dashboard/id-tags", label: "储值卡", icon: CreditCard, adminOnly: false },
|
||||
{ href: "/dashboard/transactions", label: "充电记录", icon: ListCheck, adminOnly: false },
|
||||
{ href: "/dashboard/transactions", label: "充电记录", icon: ReceiptText, adminOnly: false },
|
||||
{ href: "/dashboard/settings/pricing", label: "峰谷电价", icon: TagDollar, adminOnly: true },
|
||||
{ href: "/dashboard/users", label: "用户管理", icon: Person, adminOnly: true },
|
||||
{ href: "/dashboard/users", label: "用户管理", icon: Users, adminOnly: true },
|
||||
];
|
||||
|
||||
const settingsItems = [
|
||||
{ href: "/dashboard/settings/user", label: "账号设置", icon: Gear, adminOnly: false },
|
||||
{ href: "/dashboard/settings/user", label: "账号设置", icon: UserCog, adminOnly: false },
|
||||
];
|
||||
|
||||
function NavContent({
|
||||
|
||||
Reference in New Issue
Block a user