{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "card-task-board-task-board-1-1",
  "type": "registry:block",
  "title": "Task board",
  "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/task-board-task-board-1-1.tsx",
      "type": "registry:component",
      "target": "components/overtrue/blocks/task-board-task-board-1-1.tsx",
      "content": "\"use client\";\nimport { BlockFrame } from \"./runtime/blocks/frame\";\nimport \"./runtime/cards.css\";\n// Extracted from src/components/overtrue/scenes/projects.tsx:400.\nimport { useState } from \"react\";\nimport {\n  applyFilters,\n  type Filter,\n  type FilterField,\n} from \"./runtime/registry/overtrue/filter-bar\";\nimport { useWorkData } from \"./runtime/components/overtrue/workspace/work-data\";\nimport { useSearchParams } from \"react-router-dom\";\nimport { IconChevronDown } from \"@tabler/icons-react\";\nimport { team } from \"./runtime/data/workspace/studio\";\nimport { SceneCard, Pill, Person } from \"./runtime/components/overtrue/scenes/shared\";\n\nfunction CardExample({\n  id = \"tasks\",\n}: {\n  id?: string;\n  list?: boolean;\n} = {}) {\n  const { tasks: items, setTasks: setItems, projects } = useWorkData();\n  const [filter] = useState(\"All work\");\n  const [filters] = useState<Filter[]>([]);\n  const [] = useState(\"\");\n  const [selected, setSelected] = useState<string[]>([]);\n  const [params] = useSearchParams();\n  const query = params.get(\"q\") ?? \"\";\n  const states = [\"Planned\", \"In progress\", \"In review\", \"Complete\"];\n  const fields: FilterField[] = [\n    {\n      key: \"status\",\n      label: \"Status\",\n      type: \"enum\",\n      options: states.map((value) => ({ value, label: value })),\n    },\n    {\n      key: \"priority\",\n      label: \"Priority\",\n      type: \"enum\",\n      options: [\"High\", \"Normal\", \"Low\"].map((value) => ({\n        value,\n        label: value,\n      })),\n    },\n    {\n      key: \"project\",\n      label: \"Project\",\n      type: \"enum\",\n      options: projects.map((project) => ({\n        value: project.client,\n        label: project.name,\n      })),\n    },\n  ];\n  const shown = applyFilters(\n    items.filter(\n      (task) => filter === \"All work\" || task.person === team[0].name,\n    ),\n    filters,\n    {\n      fields,\n      query,\n      getSearchText: (task) =>\n        `${task.id} ${task.title} ${task.project} ${task.person}`,\n    },\n  );\n  const change = (taskId: string, status: string) =>\n    setItems((current) =>\n      current.map((task) => (task.id === taskId ? { ...task, status } : task)),\n    );\n\n  return (\n    <>\n      <div className=\"overtrue-block-content\" data-workspace-page={id}>\n        <SceneCard className=\"scene-table-card\">\n          <div\n            className=\"scene-table-wrap\"\n            tabIndex={0}\n            role=\"region\"\n            aria-label=\"Work queue, scroll to see all columns\"\n          >\n            <table className=\"scene-table scene-task-table\">\n              <thead>\n                <tr>\n                  <th>\n                    <input\n                      type=\"checkbox\"\n                      aria-label=\"Select all tasks\"\n                      checked={\n                        shown.length > 0 &&\n                        shown.every((task) => selected.includes(task.id))\n                      }\n                      onChange={(event) =>\n                        setSelected(\n                          event.target.checked\n                            ? shown.map((task) => task.id)\n                            : [],\n                        )\n                      }\n                    />\n                  </th>\n                  <th>Task</th>\n                  <th>Assignee</th>\n                  <th>Priority</th>\n                  <th>Status</th>\n                  <th>Due</th>\n                </tr>\n              </thead>\n              <tbody>\n                {shown.map((task) => (\n                  <tr key={task.id}>\n                    <td>\n                      <input\n                        type=\"checkbox\"\n                        aria-label={`Select ${task.id}`}\n                        checked={selected.includes(task.id)}\n                        onChange={(event) =>\n                          setSelected((current) =>\n                            event.target.checked\n                              ? [...current, task.id]\n                              : current.filter((id) => id !== task.id),\n                          )\n                        }\n                      />\n                    </td>\n                    <td>\n                      <strong>{task.title}</strong>\n                      <small>\n                        {task.id} · {task.project}\n                      </small>\n                    </td>\n                    <td>\n                      <Person name={task.person} />\n                    </td>\n                    <td>\n                      <Pill>{task.priority}</Pill>\n                    </td>\n                    <td>\n                      <span className=\"scene-select\">\n                        <select\n                          aria-label={`Status of ${task.id}`}\n                          value={task.status}\n                          onChange={(event) =>\n                            change(task.id, event.target.value)\n                          }\n                        >\n                          {states.map((status) => (\n                            <option key={status}>{status}</option>\n                          ))}\n                        </select>\n                        <IconChevronDown aria-hidden=\"true\" stroke={1.5} />\n                      </span>\n                    </td>\n                    <td>{task.due}</td>\n                  </tr>\n                ))}\n              </tbody>\n            </table>\n          </div>\n          <div className=\"scene-table-summary\">\n            <span>{shown.length} tasks in this view</span>\n            <span>Changes stay with your workspace session</span>\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/task-board-task-board-1-1. Includes the shared card foundation and hosted demo imagery. Replace sample data and navigation with your application data."
}
