import { createFileRoute } from "@tanstack/react-router";
import { requireAuthenticated } from "@remote/shared/lib/route-auth";
import { Workspaces } from "@/pages/workspaces/Workspaces";
import { RemoteWorkspacesPageShell } from "@remote/pages/RemoteWorkspacesPageShell";

export const Route = createFileRoute("/hosts/$hostId/workspaces_/create")({
  beforeLoad: async ({ location }) => {
    await requireAuthenticated(location);
  },
  component: WorkspacesCreateRouteComponent,
});

function WorkspacesCreateRouteComponent() {
  return (
    <RemoteWorkspacesPageShell>
      <Workspaces />
    </RemoteWorkspacesPageShell>
  );
}
