{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "extends": "none",
  "name": "menu-infinite-scroll-example",
  "title": "Menu Infinite Scroll",
  "description": "menu-infinite-scroll-example",
  "dependencies": [
    "react-aria-components",
    "react-stately"
  ],
  "registryDependencies": [
    "https://intentui.com/r/button",
    "https://intentui.com/r/menu",
    "https://intentui.com/r/progress-circle"
  ],
  "files": [
    {
      "path": "src/components/examples/collections/menu/menu-infinite-scroll-example.tsx",
      "content": "'use client'\n\nimport { Collection } from 'react-aria-components/Collection'\nimport { MenuLoadMoreItem } from 'react-aria-components/Menu'\nimport { useAsyncList } from 'react-stately/useAsyncList'\nimport { Button } from '@/components/ui/button'\nimport { Menu, MenuContent, MenuItem } from '@/components/ui/menu'\nimport { ProgressCircle } from '@/components/ui/progress-circle'\n\ninterface Character {\n  name: string\n  height: string\n  birth_year: string\n}\n\nexport default function MenuInfiniteScrollDemo() {\n  const list = useAsyncList<Character>({\n    async load({ signal, cursor }) {\n      if (cursor) {\n        cursor = cursor.replace(/^http:\\/\\//i, 'https://')\n      }\n\n      const res = await fetch(cursor || 'https://swapi.py4e.com/api/people', { signal })\n      const json = await res.json()\n\n      return {\n        items: json.results,\n        cursor: json.next,\n      }\n    },\n  })\n\n  return (\n    <Menu>\n      <Button intent=\"secondary\">Browse characters</Button>\n      <MenuContent aria-label=\"Star Wars characters\" className=\"max-h-72 min-w-64\">\n        <Collection items={list.items}>\n          {(item) => (\n            <MenuItem id={item.name} textValue={item.name}>\n              <span className=\"flex flex-col\">\n                <span>{item.name}</span>\n                <span className=\"text-muted-fg text-xs\">\n                  {item.height} cm · Born {item.birth_year}\n                </span>\n              </span>\n            </MenuItem>\n          )}\n        </Collection>\n        <MenuLoadMoreItem\n          className=\"col-span-full py-3\"\n          onLoadMore={list.loadMore}\n          isLoading={list.loadingState === 'loadingMore'}\n        >\n          <ProgressCircle className=\"mx-auto\" isIndeterminate aria-label=\"Loading more...\" />\n        </MenuLoadMoreItem>\n      </MenuContent>\n    </Menu>\n  )\n}\n",
      "type": "registry:page",
      "target": "app/menu-infinite-scroll-example/page.tsx"
    }
  ],
  "type": "registry:page"
}