{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "preview-data-provider",
  "title": "Preview Data Provider",
  "description": "A shared mock data provider for consistent registry demos and examples.",
  "dependencies": [],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/corr/components/preview-data-provider.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\n\nexport type PreviewFileItem = {\n  id: string\n  name: string\n  size?: string\n  modified?: string\n  type?: string\n  path?: string\n  kind?: \"file\" | \"folder\"\n}\n\nexport type PreviewProjectItem = {\n  title: string\n  label: string\n  description: string\n  href: string\n  stack: string[]\n  previewImage?: string\n}\n\nexport type PreviewMetricPoint = {\n  label: string\n  installs: number\n  copies: number\n  errors: number\n}\n\nexport type PreviewRegistryItem = {\n  slug: string\n  title: string\n  category: string\n  dependencies: string[]\n  registryDependencies: string[]\n  files: { path: string; type?: string }[]\n}\n\nexport type PreviewData = {\n  files: PreviewFileItem[]\n  projects: PreviewProjectItem[]\n  metrics: PreviewMetricPoint[]\n  registryItems: PreviewRegistryItem[]\n}\n\nexport const defaultPreviewData: PreviewData = {\n  files: [\n    {\n      id: \"folder-components\",\n      name: \"components\",\n      modified: \"Today\",\n      path: \"/\",\n      kind: \"folder\",\n    },\n    {\n      id: \"folder-media\",\n      name: \"media\",\n      modified: \"Yesterday\",\n      path: \"/\",\n      kind: \"folder\",\n    },\n    {\n      id: \"folder-components-forms\",\n      name: \"forms\",\n      modified: \"Today\",\n      path: \"/components\",\n      kind: \"folder\",\n    },\n    {\n      id: \"registry-json\",\n      name: \"registry.json\",\n      size: \"12 KB\",\n      modified: \"Today\",\n      path: \"/\",\n      type: \"json\",\n    },\n    {\n      id: \"filters\",\n      name: \"filters.tsx\",\n      size: \"34 KB\",\n      modified: \"May 12\",\n      path: \"/components/forms\",\n      type: \"tsx\",\n    },\n  ],\n  projects: [\n    {\n      title: \"UI Registry\",\n      label: \"Public component system\",\n      description: \"A shadcn-compatible registry for React projects.\",\n      href: \"https://ui.corr.sh\",\n      stack: [\"React\", \"Tailwind\", \"Motion\"],\n    },\n    {\n      title: \"Project Index\",\n      label: \"Portfolio\",\n      description: \"A compact project directory with preview cards.\",\n      href: \"https://corr.sh\",\n      stack: [\"React\", \"Content\", \"Preview\"],\n    },\n  ],\n  metrics: [\n    { label: \"Jan\", installs: 420, copies: 280, errors: 16 },\n    { label: \"Feb\", installs: 520, copies: 340, errors: 12 },\n    { label: \"Mar\", installs: 610, copies: 390, errors: 18 },\n    { label: \"Apr\", installs: 740, copies: 470, errors: 10 },\n  ],\n  registryItems: [\n    {\n      slug: \"data-table\",\n      title: \"Data Table\",\n      category: \"Components\",\n      dependencies: [\"lucide-react\"],\n      registryDependencies: [\"button\", \"table\", \"dropdown-menu\"],\n      files: [{ path: \"registry/corr/components/data-table.tsx\" }],\n    },\n    {\n      slug: \"file-manager\",\n      title: \"File Manager\",\n      category: \"Blocks\",\n      dependencies: [\"@dnd-kit/core\", \"lucide-react\", \"motion\"],\n      registryDependencies: [\"button\", \"dialog\", \"dropdown-menu\"],\n      files: [{ path: \"registry/corr/components/file-manager.tsx\" }],\n    },\n  ],\n}\n\nconst PreviewDataContext =\n  React.createContext<PreviewData>(defaultPreviewData)\n\nexport function usePreviewData() {\n  return React.useContext(PreviewDataContext)\n}\n\nexport function PreviewDataProvider({\n  children,\n  data,\n}: {\n  children: React.ReactNode | ((data: PreviewData) => React.ReactNode)\n  data?: Partial<PreviewData>\n}) {\n  const value = React.useMemo<PreviewData>(\n    () => ({\n      ...defaultPreviewData,\n      ...data,\n    }),\n    [data]\n  )\n\n  return (\n    <PreviewDataContext.Provider value={value}>\n      {typeof children === \"function\" ? children(value) : children}\n    </PreviewDataContext.Provider>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}