components/elements/ButtonGrid/index.jsjavascript
import definition from "./schema.js";
import { ButtonGrid } from "./ButtonGrid";

/**
 * Element definition consumed by elements/registry.js (pattern:
 * StoryTitle/index.js). Same navigation contract as ButtonList: the
 * component reports the chosen button's target view id back via
 * `onNavigate`, it doesn't navigate itself.
 */
export default {
  ...definition,
  component: ButtonGrid,
  adapter: ({ buttons }, { onNavigate }) => ({
    items: (buttons || []).map((button) => ({
      content: { logo: button.logo },
      targetViewId: button.id,
    })),
    onNavigate,
  }),
};