import { notFound } from "next/navigation"
import Link from "next/link"
import { ArrowLeft } from "lucide-react"
import { Button } from "@/components/ui/button"

// This would typically come from a CMS or database
const faqData = {
  "hardware-requirements": {
    title: "Do I need new hardware?",
    content: `
      <p>Any FIPS 140-2 L3 HSM with PKCS#11 works – we've tested Thales Luna, Utimaco u.trust and AWS CloudHSM.</p>
      
      <p>Our solution is designed to work with your existing hardware security infrastructure, requiring minimal changes to your current setup. The key requirements are:</p>
      
      <ul>
        <li>FIPS 140-2 Level 3 certification (or higher)</li>
        <li>PKCS#11 interface support</li>
        <li>Ability to perform digital signatures</li>
        <li>Network connectivity to your payment systems</li>
      </ul>
      
      <p>We've successfully tested our solution with the following HSM providers:</p>
      
      <ul>
        <li>Thales Luna Network HSM</li>
        <li>Utimaco u.trust Anchor</li>
        <li>AWS CloudHSM</li>
        <li>Entrust nShield</li>
      </ul>
      
      <p>If you're using a different HSM provider, please contact us to discuss compatibility.</p>
    `,
  },
  "sdk-availability": {
    title: "When will the open-source SDK be GA?",
    content: `
      <p>v1.0 is slated for Q4 2025 after crypto-agility and FedNow adaptor land.</p>
      
      <p>Our SDK development roadmap includes:</p>
      
      <ul>
        <li><strong>May 2025:</strong> SDK-beta 0.3 with AWS KMS-HSM stub & Dilithium via OpenQuantumSafe</li>
        <li><strong>July 2025:</strong> SDK-beta 0.5 with crypto-agility layer</li>
        <li><strong>September 2025:</strong> SDK-beta 0.8 with FedNow adaptor</li>
        <li><strong>November 2025:</strong> SDK v1.0 General Availability</li>
      </ul>
      
      <p>All releases will be open-source under the AGPL license, with commercial licensing options available for enterprises.</p>
    `,
  },
  "pqc-standards": {
    title: "What if PQC standards change again?",
    content: `
      <p>Our policy engine hot-swaps algorithms network-wide in minutes; no recompilation.</p>
      
      <p>Post-quantum cryptography is an evolving field, and standards may change as research progresses. We've designed our system with this in mind:</p>
      
      <ul>
        <li>Our crypto-agility layer allows for algorithm swapping without code changes</li>
        <li>Policy updates can be pushed network-wide in minutes</li>
        <li>Multiple algorithms can be supported simultaneously during transition periods</li>
        <li>All changes are backward compatible with existing integrations</li>
      </ul>
      
      <p>This approach ensures that your investment in our technology is future-proof, even as cryptographic standards evolve.</p>
    `,
  },
}

export default function FaqPage({ params }: { params: { slug: string } }) {
  const faq = faqData[params.slug as keyof typeof faqData]

  if (!faq) {
    notFound()
  }

  return (
    <div className="container py-12 md:py-24">
      <Button variant="ghost" className="mb-8 gap-2" asChild>
        <Link href="/#faq">
          <ArrowLeft className="h-4 w-4" />
          Back to FAQ
        </Link>
      </Button>

      <div className="mx-auto max-w-3xl">
        <h1 className="mb-8 text-3xl font-bold tracking-tight sm:text-4xl">{faq.title}</h1>

        <div
          className="prose prose-gray max-w-none dark:prose-invert"
          dangerouslySetInnerHTML={{ __html: faq.content }}
        />
      </div>
    </div>
  )
}
