{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "context-menu-clients",
  "title": "Context menu: client list",
  "description": "An example of Context menu: client list.",
  "dependencies": [],
  "registryDependencies": [
    "@keyline-ui/button",
    "@keyline-ui/context-menu",
    "@keyline-ui/keyline"
  ],
  "files": [
    {
      "path": "src/registry/keyline/examples/context-menu-clients.tsx",
      "content": "\"use client\";\n\nimport { useState } from \"react\";\nimport { Button } from \"../ui/button\";\nimport {\n  ContextMenu,\n  ContextMenuPopup,\n  ContextMenuItem,\n  ContextMenuSeparator,\n  ContextMenuTrigger,\n} from \"../ui/context-menu\";\n\nconst CLIENTS = [\n  { name: \"Scranton Business Park\", contact: \"Front desk\", rep: \"Dwight\" },\n  { name: \"Lackawanna County\", contact: \"Procurement office\", rep: \"Jim\" },\n  { name: \"Blue Cross of Pennsylvania\", contact: \"Accounts payable\", rep: \"Stanley\" },\n];\n\nexport function ClientList() {\n  const [log, setLog] = useState(\"Right-click a client, or focus one and press Shift+F10.\");\n  const [archived, setArchived] = useState<string[]>([]);\n  const shown = CLIENTS.filter((c) => !archived.includes(c.name));\n\n  return (\n    <div className=\"grid gap-4\">\n      <ul className=\"m-0 grid list-none gap-2 p-0\" aria-label=\"Clients\">\n        {shown.map((c) => (\n          <li key={c.name}>\n            <ContextMenu>\n              <ContextMenuTrigger\n                tabIndex={0}\n                aria-label={`${c.name}. Actions available from the context menu.`}\n                className=\"grid gap-0.5 border border-kl-line bg-kl-paper px-4 py-3 text-[14px] outline-offset-2 focus-visible:outline-2 focus-visible:outline-current\"\n              >\n                <strong>{c.name}</strong>\n                <span className=\"text-kl-ink-2\">\n                  {c.contact} · {c.rep}’s account\n                </span>\n              </ContextMenuTrigger>\n              <ContextMenuPopup>\n                <ContextMenuItem onClick={() => setLog(`Calling ${c.name}, ${c.contact}.`)}>Call</ContextMenuItem>\n                <ContextMenuItem onClick={() => setLog(`New order started for ${c.name}.`)}>New order</ContextMenuItem>\n                <ContextMenuItem\n                  onClick={() => setLog(`${c.rep} will get a reminder to follow up with ${c.name} on Friday.`)}\n                >\n                  Remind {c.rep} to follow up\n                </ContextMenuItem>\n                <ContextMenuSeparator />\n                <ContextMenuItem\n                  variant=\"destructive\"\n                  onClick={() => {\n                    setArchived([...archived, c.name]);\n                    setLog(`${c.name} archived.`);\n                  }}\n                >\n                  Archive client\n                </ContextMenuItem>\n              </ContextMenuPopup>\n            </ContextMenu>\n          </li>\n        ))}\n      </ul>\n      {shown.length === 0 ? (\n        <div className=\"grid justify-items-start gap-3 border border-dashed border-kl-line-soft px-4 py-4 text-[14px]\">\n          <p className=\"m-0\">No clients left on the list. Michael would call this a crisis.</p>\n          <Button size=\"compact\" onClick={() => setArchived([])}>\n            Restore all three\n          </Button>\n        </div>\n      ) : null}\n      <p role=\"status\" className=\"m-0 min-h-5 text-[14px] text-kl-ink-2\">\n        {log}\n      </p>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/keyline/examples/context-menu-clients.tsx"
    }
  ],
  "categories": [
    "context-menu"
  ],
  "type": "registry:block"
}