import { useEffect, useMemo, useRef, useState } from "react"; import { Button, GlassSurface, Icon, IconButton, Select, SettingsCard, StatusBadge, Switch, TextField, } from "@nodedc/ui-react"; import { createConfigurationRevision, setDesiredConfiguration, updateDevice, } from "./api"; import { accessLabel, getDeviceProfileCatalog, type DeviceFieldAccess, type DeviceProfileField, } from "./deviceProfileCatalog"; import type { DeviceView, ProjectWorkspace, SessionView, } from "./types"; export type DeviceInventoryDetailState = { deviceRef: string; sectionId: string; editing: boolean; }; export function DeviceDetailHeaderTools({ device, detail, canEdit, onDetailChange, }: { device: DeviceView; detail: DeviceInventoryDetailState; canEdit: boolean; onDetailChange: (detail: DeviceInventoryDetailState | null) => void; }) { const catalog = getDeviceProfileCatalog(device.modelProfileRef); const activeSection = catalog.sections.find((section) => section.id === detail.sectionId) ?? catalog.sections[0]; return (