{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "card-project-menus-project-menus-1-1",
  "type": "registry:block",
  "title": "Project menus 1",
  "description": "Projects card from the overtrue/ui workspace examples. Editable source, scoped styles, and demo interactions.",
  "categories": [
    "cards",
    "projects"
  ],
  "registryDependencies": [
    "https://ui.overtrue.xyz/r/overtrue-card-foundation.json"
  ],
  "files": [
    {
      "path": "src/blocks/registry/project-menus-project-menus-1-1.tsx",
      "type": "registry:component",
      "target": "components/overtrue/blocks/project-menus-project-menus-1-1.tsx",
      "content": "\"use client\";\nimport { BlockFrame } from \"./runtime/blocks/frame\";\nimport \"./runtime/cards.css\";\n// Extracted from src/components/overtrue/scenes/workflows.tsx:421.\nimport { useState } from \"react\";\nimport { Link } from \"react-router-dom\";\nimport { IconDots } from \"@tabler/icons-react\";\nimport {\n  DropdownMenu,\n  DropdownMenuTrigger,\n  DropdownMenuContent,\n  DropdownMenuItem,\n  DropdownMenuSeparator,\n} from \"./runtime/components/ui/dropdown-menu\";\nimport { useWorkData } from \"./runtime/components/overtrue/workspace/work-data\";\nimport { SceneCard, Pill, Person } from \"./runtime/components/overtrue/scenes/shared\";\n\nfunction CardExample() {\n  const { projects, setProjects } = useWorkData();\n  const [query] = useState(\"\");\n  const [, setNotice] = useState(\"\");\n  const shown = projects.filter((project) =>\n    `${project.name} ${project.client}`\n      .toLowerCase()\n      .includes(query.trim().toLowerCase()),\n  );\n\n  return (\n    <>\n      <div className=\"overtrue-block-content\" data-workspace-page=\"dropdowns\">\n        <SceneCard className=\"scene-table-card\">\n          <div\n            className=\"scene-table-wrap\"\n            tabIndex={0}\n            role=\"region\"\n            aria-label=\"Project actions\"\n          >\n            <table className=\"scene-table\">\n              <thead>\n                <tr>\n                  <th>Project</th>\n                  <th>Owner</th>\n                  <th>Status</th>\n                  <th>Delivery</th>\n                  <th>\n                    <span className=\"sr-only\">Actions</span>\n                  </th>\n                </tr>\n              </thead>\n              <tbody>\n                {shown.map((project) => (\n                  <tr key={project.id}>\n                    <td>\n                      <Link to={`/datagrid?project=${project.id}`}>\n                        <strong>{project.name}</strong>\n                      </Link>\n                      <small>{project.client}</small>\n                    </td>\n                    <td>\n                      <Person name={project.owner} />\n                    </td>\n                    <td>\n                      <Pill>{project.status}</Pill>\n                    </td>\n                    <td>{project.due}</td>\n                    <td>\n                      <DropdownMenu>\n                        <DropdownMenuTrigger asChild>\n                          <button\n                            className=\"scene-icon-action\"\n                            aria-label={`Actions for ${project.name}`}\n                          >\n                            <IconDots size={18} />\n                          </button>\n                        </DropdownMenuTrigger>\n                        <DropdownMenuContent>\n                          <DropdownMenuItem asChild>\n                            <Link to={`/datagrid?project=${project.id}`}>\n                              Open project\n                            </Link>\n                          </DropdownMenuItem>\n                          <DropdownMenuItem asChild>\n                            <Link\n                              to={`/tasks-list?q=${encodeURIComponent(project.client)}`}\n                            >\n                              View deliverables\n                            </Link>\n                          </DropdownMenuItem>\n                          <DropdownMenuSeparator />\n                          <DropdownMenuItem\n                            onSelect={() => {\n                              setProjects((current) =>\n                                current.map((item) =>\n                                  item.id === project.id\n                                    ? {\n                                        ...item,\n                                        status:\n                                          project.status === \"Complete\"\n                                            ? \"In progress\"\n                                            : \"Complete\",\n                                        progress:\n                                          project.status === \"Complete\"\n                                            ? 0\n                                            : 100,\n                                      }\n                                    : item,\n                                ),\n                              );\n                              setNotice(\n                                `${project.name} ${project.status === \"Complete\" ? \"reopened\" : \"completed\"}.`,\n                              );\n                            }}\n                          >\n                            {project.status === \"Complete\"\n                              ? \"Reopen project\"\n                              : \"Mark complete\"}\n                          </DropdownMenuItem>\n                        </DropdownMenuContent>\n                      </DropdownMenu>\n                    </td>\n                  </tr>\n                ))}\n              </tbody>\n            </table>\n            {!shown.length && (\n              <p className=\"scene-empty\">No projects match your search.</p>\n            )}\n          </div>\n        </SceneCard>\n      </div>\n    </>\n  );\n}\n\nexport default function Block() { return <BlockFrame><CardExample /></BlockFrame>; }\n"
    }
  ],
  "docs": "Documentation: https://ui.overtrue.xyz/blocks/project-menus-project-menus-1-1. Includes the shared card foundation and hosted demo imagery. Replace sample data and navigation with your application data."
}
