{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "wysiwyg-viewer",
  "title": "WYSIWYG Viewer",
  "description": "A WYSIWYG content viewer component.",
  "dependencies": [],
  "registryDependencies": [],
  "files": [
    {
      "path": "src/components/ui/wysiwyg-viewer.tsx",
      "content": "import { domPurifySanitizer, sanitizeHtmlWithBr } from \"@/utlis/string\";\nimport { cn } from \"@/stories/lib/utils\";\n\ninterface WysiwygViewerProps {\n  mode?: \"html\" | \"text\";\n  className?: string;\n  children?: string;\n}\n\nexport const WysiwygViewer = ({\n  children,\n  mode = \"html\",\n  className,\n}: WysiwygViewerProps) => {\n  const childrenToString = children?.toString() ?? \"\";\n  const content =\n    mode === \"html\" ? childrenToString : sanitizeHtmlWithBr(childrenToString);\n\n  return (\n    <div\n      // Note: In case we need to update how HTML looks, we will need to add our own styles implementation\n      className={cn(\n        \"max-w-none whitespace-pre-line [&_a:hover]:underline [&_a]:text-blue-500\",\n        \"[&_ul:first-child]:mt-0\",\n        \"[&_ul]:my-2 [&_ul]:ml-6 [&_ul]:list-disc\",\n        \"[&_ol]:my-2 [&_ol]:ml-6 [&_ol]:list-decimal\",\n        className,\n      )}\n      dangerouslySetInnerHTML={{ __html: domPurifySanitizer(content ?? \"\") }}\n    />\n  );\n};\n",
      "type": "registry:ui",
      "target": "components/ui/wysiwyg-viewer.tsx"
    }
  ],
  "type": "registry:ui"
}