import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
import {
  MasterDetailTable
} from "./chunk-DWYIZZUB.mjs";

// src/panels/halo/KeyringPanel/KeyringPanel.tsx
import React, { useMemo } from "react";
import { Format } from "@dxos/echo/internal";
import { PublicKey } from "@dxos/keys";
import { useDevtools, useStream } from "@dxos/react-client/devtools";
var KeyringPanel = () => {
  const devtoolsHost = useDevtools();
  const { keys } = useStream(() => devtoolsHost.subscribeToKeyringKeys({}), {});
  const properties = useMemo(() => [
    {
      name: "publicKey",
      title: "Public Key",
      format: Format.TypeFormat.DID
    }
  ], []);
  const data = useMemo(() => keys?.map((record) => ({
    id: PublicKey.from(record.publicKey).toHex(),
    publicKey: PublicKey.from(record.publicKey).toHex(),
    _original: record
  })) || [], [
    keys
  ]);
  if (keys === void 0) {
    return null;
  }
  return /* @__PURE__ */ React.createElement(MasterDetailTable, {
    properties,
    data,
    detailsTransform: (d) => d._original,
    detailsPosition: "bottom"
  });
};

// src/panels/halo/KeyringPanel/index.ts
var KeyringPanel_default = KeyringPanel;
export {
  KeyringPanel_default as default
};
//# sourceMappingURL=KeyringPanel-77YQDU4M.mjs.map
