Repairs
Device repair and maintenance log tracking — spare-part changes sub-row
@tetherto/mdk-react-devkit/foundation
Repairs components display spare-part changes recorded in device repair batch actions. Pair with the Operations centre for full device-management context.
Prerequisites
Components
RepairLogChangesSubRow
Expandable sub-row that lists the spare-part changes recorded in a repair batch action. Each non-miner repair action is resolved against its device to show the part type, serial number, MAC address, and whether the part was added or removed. Renders as a DataTable; shows a Spinner when isLoading is true.
The component does no data fetching — the parent fetches the batch action and its associated devices (for example via the things API) and passes them as props.
Import
import { RepairLogChangesSubRow } from '@tetherto/mdk-react-devkit/foundation'
import type {
RepairLogChangesSubRowProps,
RepairBatchAction,
RepairDevice,
} from '@tetherto/mdk-react-devkit/foundation'Props
| Prop | Status | Type | Default | Description |
|---|---|---|---|---|
batchAction | Required | RepairBatchAction | none | The repair batch action whose part changes are displayed |
devices | Required | RepairDevice[] | none | Devices referenced by the batch action, pre-fetched by the parent |
isLoading | Optional | boolean | false | When true, renders a spinner instead of the table |
Supporting types
type RepairBatchAction = Partial<{
params: RepairAction[]
}>
type RepairAction = Partial<{
params: RepairActionParam[]
}>
type RepairActionParam = Partial<{
comment: string
id: string
rackId: string
info: { parentDeviceId: string | null }
}>
type RepairDevice = Partial<{
id: string
rack: string
info: Partial<{
serialNum: string
macAddress: string
}>
}>Basic usage
import { RepairLogChangesSubRow } from '@tetherto/mdk-react-devkit/foundation'
import type { RepairBatchAction, RepairDevice } from '@tetherto/mdk-react-devkit/foundation'
const batchAction: RepairBatchAction = {
params: [
{
params: [
{
id: 'inventory-miner_part-hashboard-001',
rackId: 'inventory-miner_part-hashboard',
info: { parentDeviceId: null },
},
],
},
],
}
const devices: RepairDevice[] = [
{
id: 'inventory-miner_part-hashboard-001',
rack: 'inventory-miner_part-hashboard',
info: { serialNum: 'HB-SN-0001', macAddress: 'AA:BB:CC:00:00:01' },
},
]
<RepairLogChangesSubRow batchAction={batchAction} devices={devices} />Loading state
<RepairLogChangesSubRow
batchAction={batchAction}
devices={[]}
isLoading
/>Behavior notes
- Miner rack actions and actions with a
commentfield are filtered out — only spare-part changes appear in the table. - A part is marked Removed when
parentDeviceIdisnull; Added whenparentDeviceIdreferences a parent device. - Part type labels come from
MINER_TYPE_NAME_MAPandSparePartNames; unrecognised rack IDs display asUnknown. - Pagination is disabled by default.
Next steps
- For device-level details, see the Operations centre pages