"use client";

import { useSearchParams } from "next/navigation";

import { AgentsConsole } from "@/modules/agents/agents-console";
import { AgentsDirectoryConsole } from "@/modules/agents/agents-directory-console";

export function AgentsManagementScreen(): React.ReactElement {
  const searchParams = useSearchParams();
  const view = searchParams.get("view") === "list" ? "list" : "tree";

  if (view === "list") {
    return <AgentsDirectoryConsole />;
  }

  return <AgentsConsole />;
}