import type { User, Asset, Category, Announcement } from "../types";

// Pre-defined categories
export const SEED_CATEGORIES: Category[] = [
  {
    id: "silicon",
    name: "Silicon",
    subcategories: [
      "FPGA Modules",
      "RISC-V Cores",
      "ASIC Accelerators",
      "Memory Controllers",
    ],
  },
  {
    id: "software",
    name: "Software",
    subcategories: [
      "CodeNuk Framework",
      "Core Libraries",
      "System Drivers",
      "SDKs & Tools",
    ],
  },
  {
    id: "ai",
    name: "AI",
    subcategories: [
      "Large Language Models",
      "Speech Recognition",
      "Computer Vision",
      "Agentic Workflows",
    ],
  },
  {
    id: "cloud",
    name: "Cloud",
    subcategories: [
      "Kubernetes Operators",
      "Terraform Modules",
      "Serverless Functions",
      "DB Connectors",
    ],
  },
];

// Pre-defined seed assets
export const SEED_ASSETS: Asset[] = [
  {
    id: "asset-1",
    title: "RISC-V High-Performance Quad-Core IP Block",
    description:
      "A synthesizable quad-core RISC-V processor IP core designed for edge computing applications. Supports RV64GC instruction set, includes a 32KB L1 cache, and has been optimized for low power consumption.",
    categoryId: "silicon",
    subcategory: "RISC-V Cores",
    tags: ["RISC-V", "IP-Core", "Hardware", "Edge-Computing"],
    author: "Silicon Engineering Team",
    publishDate: "2026-06-15",
    thumbnailUrl:
      "https://images.unsplash.com/photo-1518770660439-4636190af475?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3",
    downloadUrl: "/downloads/riscv-quad-core-spec.pdf",
    githubUrl: "https://github.com/tech4biz/riscv-quad-core",
    status: "published",
    downloadsCount: 142,
  },
  {
    id: "asset-2",
    title: "FPGA Cryptographic Accelerator IP",
    description:
      "Hardware accelerator IP for Xilinx UltraScale+ FPGAs providing high-throughput AES-GCM and SHA-3 hashing. Optimized for network security processors and TLS termination offloading.",
    categoryId: "silicon",
    subcategory: "FPGA Modules",
    tags: ["FPGA", "Crypto", "Security", "AES-GCM"],
    author: "Security Hardware Group",
    publishDate: "2026-06-20",
    thumbnailUrl:
      "https://images.unsplash.com/photo-1601524909162-be87252be298?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3",
    downloadUrl: "/downloads/fpga-crypto-accel.zip",
    githubUrl: "https://github.com/tech4biz/fpga-crypto-accel",
    status: "published",
    downloadsCount: 89,
  },
  {
    id: "asset-3",
    title: "CodeNuk Core Framework v3.2.0",
    description:
      "The definitive micro-service framework for rapid enterprise deployments. Includes built-in service discovery, dynamic routing, and automated telemetry dashboard injection.",
    categoryId: "software",
    subcategory: "CodeNuk Framework",
    tags: ["Framework", "Microservices", "NodeJS", "TypeScript"],
    author: "CodeNuk Team",
    publishDate: "2026-06-28",
    thumbnailUrl:
      "https://images.unsplash.com/photo-1555066931-4365d14bab8c?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3",
    downloadUrl: "/downloads/codenuk-core-3.2.0.tgz",
    githubUrl: "https://github.com/tech4biz/codenuk-core",
    status: "published",
    downloadsCount: 312,
  },
  {
    id: "asset-4",
    title: "Automated Agentic Orchestrator (AAO)",
    description:
      "An advanced multi-agent coordination library that schedules, monitors, and optimizes LLM-based autonomous workflows. Features memory persistence and automatic fallback paths.",
    categoryId: "ai",
    subcategory: "Agentic Workflows",
    tags: ["AI-Agents", "Orchestrator", "LLM", "Python"],
    author: "AI Research Lab",
    publishDate: "2026-06-29",
    thumbnailUrl:
      "https://images.unsplash.com/photo-1677442136019-21780efad99a?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3",
    downloadUrl: "/downloads/agentic-orchestrator.tar.gz",
    githubUrl: "https://github.com/tech4biz/agentic-orchestrator",
    status: "published",
    downloadsCount: 220,
  },
  {
    id: "asset-5",
    title: "Multi-Cloud Kubernetes Operator for DBs",
    description:
      "A cloud-agnostic Kubernetes operator that manages replication, backups, and failover for PostgreSQL databases across AWS, GCP, and Azure environments.",
    categoryId: "cloud",
    subcategory: "Kubernetes Operators",
    tags: ["Kubernetes", "Operator", "Database", "Multi-Cloud"],
    author: "Cloud Infra Team",
    publishDate: "2026-05-12",
    thumbnailUrl:
      "https://images.unsplash.com/photo-1667372393119-3d4c48d07fc9?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3",
    downloadUrl: "/downloads/k8s-db-operator.yaml",
    status: "published",
    downloadsCount: 154,
  },
  {
    id: "asset-6",
    title: "Secure Enclave Storage Driver",
    description:
      "Low-level device driver providing unified APIs for Intel SGX and AMD SEV secure enclave storage. Useful for storing cryptographic keys and private data locally.",
    categoryId: "software",
    subcategory: "System Drivers",
    tags: ["System-Programming", "Enclave", "Intel-SGX", "Security"],
    author: "Systems Lab",
    publishDate: "2026-07-01",
    thumbnailUrl:
      "https://images.unsplash.com/photo-1563986768609-322da13575f3?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3",
    downloadUrl: "/downloads/secure-enclave-driver.tar.gz",
    githubUrl: "https://github.com/tech4biz/enclave-driver",
    status: "draft",
    downloadsCount: 0,
  },
];



// Pre-defined seed announcements
export const SEED_ANNOUNCEMENTS: Announcement[] = [
  {
    id: "ann-1",
    title: "Scheduled Maintenance: Client Portal API Gateway Upgrade",
    content:
      "We will be upgrading our client portal API Gateway on Sunday, July 5th, from 02:00 to 04:00 UTC. During this window, you may experience brief authentication interruptions.",
    date: "2026-07-01",
    severity: "info",
  },
  {
    id: "ann-2",
    title: "New Asset Category: Agentic Workflows Now Live!",
    content:
      "We have added a brand new subcategory under AI for Agentic Workflows. Check out our first release: the Automated Agentic Orchestrator (AAO) for multi-agent coordination.",
    date: "2026-06-30",
    severity: "success",
  },
];

// Function to initialize storage
export const initializeStorage = () => {
  if (!localStorage.getItem("t4b_users")) {
    const seedUsers: User[] = [
      {
        id: "user-admin",
        email: "admin@tech4biz.com",
        role: "ADMIN",
        companyName: "Tech4Biz Corp",
        website: "https://tech4biz.io",
        sector: "Technology",
        companySize: "100-500",
        onboardingStatus: "APPROVED",
        mfaVerified: true,
        createdAt: "2026-01-01T00:00:00.000Z",
      },
      {
        id: "user-client-approved",
        email: "client@tech4biz.com",
        role: "CLIENT",
        companyName: "Acme Innovation",
        website: "https://acme-inn.com",
        sector: "Automotive",
        companySize: "50-100",
        onboardingStatus: "APPROVED",
        mfaVerified: true,
        ndaSignature: {
          type: "draw",
          dataUrl:
            "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
          date: "2026-06-10T10:00:00.000Z",
        },
        msaSignature: {
          type: "draw",
          dataUrl:
            "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
          date: "2026-06-10T10:15:00.000Z",
        },
        createdAt: "2026-06-09T08:00:00.000Z",
      },
      {
        id: "user-client-pending",
        email: "pendingclient@tech4biz.com",
        role: "CLIENT",
        companyName: "Genesis Biotech",
        website: "https://genesisbio.com",
        sector: "Semiconductors",
        companySize: "10-50",
        onboardingStatus: "PENDING_APPROVAL",
        mfaVerified: true,
        ndaSignature: {
          type: "draw",
          dataUrl:
            "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
          date: "2026-07-02T02:05:00.000Z",
        },
        msaSignature: {
          type: "draw",
          dataUrl:
            "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
          date: "2026-07-02T02:10:00.000Z",
        },
        createdAt: "2026-07-02T02:00:00.000Z",
      },
      {
        id: "user-client-new",
        email: "newclient@tech4biz.com",
        role: "CLIENT",
        onboardingStatus: "NOT_STARTED",
        mfaVerified: false,
        createdAt: "2026-07-01T12:00:00.000Z",
      },
    ];
    localStorage.setItem("t4b_users", JSON.stringify(seedUsers));
  }

  if (!localStorage.getItem("t4b_assets")) {
    localStorage.setItem("t4b_assets", JSON.stringify(SEED_ASSETS));
  }

  if (!localStorage.getItem("t4b_categories")) {
    localStorage.setItem("t4b_categories", JSON.stringify(SEED_CATEGORIES));
  }



  if (!localStorage.getItem("t4b_announcements")) {
    localStorage.setItem(
      "t4b_announcements",
      JSON.stringify(SEED_ANNOUNCEMENTS),
    );
  }
};
