diff --git a/src/app/admin/machines/[id]/page.tsx b/src/app/admin/machines/[id]/page.tsx index 3ba7eb1..d5a6809 100644 --- a/src/app/admin/machines/[id]/page.tsx +++ b/src/app/admin/machines/[id]/page.tsx @@ -1,7 +1,7 @@ "use client" import Link from "next/link" -import { useMemo } from "react" +import { use, useMemo } from "react" import { useQuery } from "convex/react" import type { Id } from "@/convex/_generated/dataModel" import { AppShell } from "@/components/app-shell" @@ -14,8 +14,8 @@ import { useAuth } from "@/lib/auth-client" export const runtime = "nodejs" export const dynamic = "force-dynamic" -export default function AdminMachineDetailsPage({ params }: { params: { id: string } }) { - const { id } = params +export default function AdminMachineDetailsPage({ params }: { params: Promise<{ id: string }> }) { + const { id } = use(params) const { convexUserId } = useAuth() const machines = useQuery( convexUserId ? api.machines.listByTenant : "skip", diff --git a/src/components/admin/machines/admin-machines-overview.tsx b/src/components/admin/machines/admin-machines-overview.tsx index a12a0cc..a1784f7 100644 --- a/src/components/admin/machines/admin-machines-overview.tsx +++ b/src/components/admin/machines/admin-machines-overview.tsx @@ -213,6 +213,14 @@ function getStatusVariant(status?: string | null) { } } +function osIcon(osName?: string | null) { + const name = (osName ?? "").toLowerCase() + if (name.includes("windows")) return "🪟" + if (name.includes("mac") || name.includes("darwin") || name.includes("macos")) return "" + if (name.includes("linux")) return "🐧" + return "🖥️" +} + export function AdminMachinesOverview({ tenantId }: { tenantId: string }) { const machines = useMachinesQuery(tenantId) const [q, setQ] = useState("") @@ -558,20 +566,24 @@ export function MachineDetails({ machine }: MachineDetailsProps) { {/* ping integrado na badge de status */}