import Link from "next/link";
import MarkdownView from "@/components/MarkdownView";

// In-app viewer for the pack's install guides, deep-linked from the Home
// "Getting Started" checklist. The markdown is served (whitelisted) by
// /api/home/setup-status?guide=<doc>.
export default async function SetupGuidePage({ params }: { params: Promise<{ doc: string }> }) {
  const { doc } = await params;
  const src = `/api/home/setup-status?guide=${encodeURIComponent(decodeURIComponent(doc))}`;
  return (
    <div className="max-w-[860px] mx-auto">
      <Link
        href="/"
        className="focus-ring inline-flex items-center gap-1.5 mb-5 action-tag hover:opacity-100 transition-opacity"
        style={{ color: "var(--gold)", opacity: 0.85 }}
      >
        ← Back to Home
      </Link>
      <MarkdownView src={src} />
    </div>
  );
}
