import { redirect } from "next/navigation";

/**
 * /[workspace]/project/[projectId]
 *
 * Bare project URL is a server-side redirect into the default tab
 * (Product). The actual landing experience lives under
 * `/[workspace]/project/[projectId]/product` with the shared tab
 * shell rendered by `(home)/layout.tsx`.
 *
 * Why redirect rather than render: keeping every tab as its own URL
 * means refresh / back / share always lands the user on the right
 * surface, and Next.js can prefetch each tab independently.
 */
export default async function ProjectIndexPage({
  params,
}: {
  params: Promise<{ workspace: string; projectId: string }>;
}) {
  const { workspace, projectId } = await params;
  redirect(`/${workspace}/project/${projectId}/preview`);
}
