import { lazy } from "react";
import type { PlimiPlugin } from "../../core/plugins/plugin-types";

export type SvgViewerOptions = Record<string, never>;

const SvgViewerUi = lazy(() => import("./SvgViewerUi"));

export const svgViewerPlugin: PlimiPlugin<SvgViewerOptions> = {
  manifest: {
    id: "svg-viewer",
    name: "SVG Viewer",
    description:
      "Open, inspect, zoom, and download SVG files entirely in your browser.",
    category: "image",
    version: "1.0.0",
    tags: ["svg", "vector", "viewer", "preview", "xml"],
    input: {
      type: "text-or-files",
      accept: ["image/svg+xml", ".svg"],
      maxSizeMb: 10,
    },
    output: { type: "files" },
    offlineReady: true,
  },

  capabilities: {
    customUi: true,
    preview: true,
  },

  permissions: {
    network: "none",
    clipboard: "write",
    fileSystem: "read-write",
  },

  customUi: SvgViewerUi,
};
