/**
 * MCPEngine Studio — Project Deploy Page
 *
 * Route: /projects/[id]/deploy
 */

import { DeployPage } from '@/components/deploy/DeployPage';

// ---------------------------------------------------------------------------
// Page params
// ---------------------------------------------------------------------------

interface DeployPageParams {
  params: Promise<{ id: string }>;
}

// ---------------------------------------------------------------------------
// Page
// ---------------------------------------------------------------------------

export default async function ProjectDeployPage({ params }: DeployPageParams) {
  const { id } = await params;

  // TODO: Fetch real project data from DB
  // import { db } from '@/lib/db';
  // import { projects } from '@mcpengine/db/schema';
  // import { eq } from 'drizzle-orm';
  // const project = await db.query.projects.findFirst({
  //   where: eq(projects.id, id),
  // });
  // if (!project) notFound();

  // Placeholder project data — will be replaced with real DB query
  const project = {
    id,
    name: 'MCP Server',
    slug: id.slice(0, 12),
  };

  return (
    <div className="min-h-screen bg-gray-950 px-4 py-12 sm:px-6 lg:px-8">
      <DeployPage
        projectId={project.id}
        projectName={project.name}
        projectSlug={project.slug}
      />
    </div>
  );
}

// ---------------------------------------------------------------------------
// Metadata
// ---------------------------------------------------------------------------

export function generateMetadata() {
  return {
    title: 'Deploy — MCPEngine Studio',
    description: 'Deploy your MCP server to the cloud',
  };
}
