{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "jsonforms-enum-cell",
  "description": "JSONForms select cell for enum fields inside array table layouts.",
  "dependencies": [
    "@jsonforms/core",
    "@jsonforms/react"
  ],
  "registryDependencies": [
    "select"
  ],
  "files": [
    {
      "path": "registry/forms/renderers/cells/enum-cell.tsx",
      "content": "import { CellProps, isEnumControl, rankWith } from '@jsonforms/core';\nimport { withJsonFormsCellProps } from '@jsonforms/react';\n\nimport {\n    Select,\n    SelectContent,\n    SelectItem,\n    SelectTrigger,\n    SelectValue,\n} from '~/components/ui/select';\n\nconst EnumCell = ({ data, handleChange, path, enabled, schema }: CellProps) => {\n    const options = (schema.enum ?? []) as string[];\n    return (\n        <Select\n            value={data ?? ''}\n            onValueChange={value => handleChange(path, value)}\n            disabled={!enabled}\n        >\n            <SelectTrigger className=\"h-8 text-xs\">\n                <SelectValue />\n            </SelectTrigger>\n            <SelectContent>\n                {options.map(opt => (\n                    <SelectItem key={opt} value={opt} className=\"text-xs\">\n                        {opt}\n                    </SelectItem>\n                ))}\n            </SelectContent>\n        </Select>\n    );\n};\n\nexport const enumCellTester = rankWith(2, isEnumControl);\nexport default withJsonFormsCellProps(EnumCell);",
      "type": "registry:component",
      "target": "components/forms/renderers/cells/enum-cell.tsx"
    }
  ],
  "type": "registry:component"
}