{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "demo-components-animate-code-block",
  "title": "Code Block Demo",
  "description": "Demo showing a code block frame with a Python snippet.",
  "registryDependencies": [
    "odyssey/components-animate-code-block"
  ],
  "files": [
    {
      "path": "registry/demo/components/animate/code-block/index.tsx",
      "content": "'use client';\n\nimport { CodeFrame } from '@/components/odyssey/components/animate/code-block';\n\ninterface CodeFrameDemoProps {\n  typeEffect: boolean;\n  duration: number;\n  delay: number;\n  theme: string;\n  language: string;\n}\n\nconst SNIPPETS: Record<string, string> = {\n  python: `from contextlib import contextmanager\nfrom typing import Generator\n\n@contextmanager\ndef safe_file_operation(filepath: str, mode: str = 'r') -> Generator:\n    \"\"\"Context manager for safe file operations.\"\"\"\n    file = None\n    try:\n        file = open(filepath, mode)\n        yield file\n    except FileNotFoundError:\n        print(f\"File {filepath} not found\")\n        raise\n    except IOError as e:\n        print(f\"IO error: {e}\")\n        raise\n    finally:\n        if file:\n            file.close()\n\n# Usage\nwith safe_file_operation('data.txt', 'r') as f:\n    content = f.read()\n    print(content)`,\n  javascript: `import { useState, useEffect } from 'react';\n\nfunction useFetch(url) {\n  const [data, setData] = useState(null);\n  const [loading, setLoading] = useState(true);\n  const [error, setError] = useState(null);\n\n  useEffect(() => {\n    const controller = new AbortController();\n    fetch(url, { signal: controller.signal })\n      .then((res) => res.json())\n      .then(setData)\n      .catch(setError)\n      .finally(() => setLoading(false));\n    return () => controller.abort();\n  }, [url]);\n\n  return { data, loading, error };\n}\n\nexport default useFetch;`,\n  react: `'use client';\n \nimport * as React from 'react';\n  \ntype MyComponentProps = {\n  myProps: string;\n} & React.ComponentProps<'div'>;\n  \nfunction MyComponent(props: MyComponentProps) {\n  return (\n    <div {...props}>\n      <p>My Component</p>\n    </div>\n  );\n}\n\nexport { MyComponent, type MyComponentProps };`,\n  java: `import java.util.Optional;\nimport java.util.function.Function;\n\npublic class Either<L, R> {\n    private final L left;\n    private final R right;\n\n    private Either(L left, R right) {\n        this.left = left;\n        this.right = right;\n    }\n\n    public static <L, R> Either<L, R> left(L value) {\n        return new Either<>(value, null);\n    }\n\n    public static <L, R> Either<L, R> right(R value) {\n        return new Either<>(null, value);\n    }\n\n    public boolean isRight() { return right != null; }\n\n    public <T> T fold(Function<L, T> leftFn, Function<R, T> rightFn) {\n        return isRight() ? rightFn.apply(right) : leftFn.apply(left);\n    }\n}`,\n};\n\nexport const CodeFrameDemo = ({\n  typeEffect,\n  duration,\n  delay,\n  theme,\n  language,\n}: CodeFrameDemoProps) => {\n  const code = SNIPPETS[language] ?? SNIPPETS['react'];\n  return (\n    <CodeFrame\n      key={`${typeEffect}-${duration}-${delay}-${language}-${theme}`}\n      code={code}\n      language={language}\n      typeEffect={typeEffect}\n      duration={duration}\n      delay={delay}\n      theme={theme}\n      className=\"w-125\"\n    />\n  );\n};\n",
      "type": "registry:ui",
      "target": "components/odyssey/demo/animate/code-block.tsx"
    }
  ],
  "meta": {
    "demoProps": {
      "CodeFrame": {
        "delay": {
          "value": 0,
          "min": 0,
          "max": 3000,
          "step": 100
        },
        "duration": {
          "value": 5000,
          "min": 500,
          "max": 30000,
          "step": 500
        },
        "typeEffect": {
          "value": true
        },
        "theme": {
          "value": "one-dark-pro",
          "options": {
            "One Dark Pro": "one-dark-pro",
            "GitHub Dark": "github-dark",
            "GitHub Light": "github-light",
            "Dracula": "dracula",
            "Nord": "nord",
            "Monokai": "monokai",
            "Tokyo Night": "tokyo-night",
            "Solarized Dark": "solarized-dark"
          }
        },
        "language": {
          "value": "react",
          "options": {
            "React": "react",
            "Python": "python",
            "JavaScript": "javascript",
            "Java": "java"
          }
        }
      }
    }
  },
  "type": "registry:ui"
}