vemu.

component

GenericInspector

Default inspector view used for any peripheral that has no domain-specific view registered in `PERIPHERAL_VIEWS`. Renders the raw snapshot field map, pretty-printing any JSON-string fields. This is what makes "implement the inspector, see it in the UI" work before a custom view exists. Accepts the uniform PeripheralViewProps shape, so it can stand in for any registered view.

function GenericInspector(props: PeripheralViewProps): JSX.Element

Props

NameTypeDescription
namestringPeripheral name as reported by the machine (e.g. "kmu", "uicr").
eventsPeripheralEvent[]All peripheral events seen so far; the view filters for the ones it cares about.
refreshKeynumberMonotonic counter that increments whenever new events arrive.
getSnapshot() => PeripheralSnapshot | nullPull the current snapshot for this peripheral (null if unavailable).
sendCommand(cmd: { name: string; params: Record<string, string> }) => voidSend a command to this peripheral's inspector.

Examples

<GenericInspector
  name="uicr"
  events={peripheralEvents}
  refreshKey={snapshotVersion}
  getSnapshot={() => getPeripheralSnapshot("uicr")}
  sendCommand={(cmd) => sendPeripheralCommand("uicr", cmd)}
/>