import { TasksClient } from "@/components/tasks-client";
import { listFleetAgents } from "@/lib/agents";
import { listTaskEvents, listTaskTemplates, listTasks } from "@/lib/tasks";

export const dynamic = "force-dynamic";

export default async function TasksPage() {
  const [tasks, agents, templates, events] = await Promise.all([
    listTasks(),
    listFleetAgents(),
    listTaskTemplates(),
    listTaskEvents(undefined, 12),
  ]);
  return <TasksClient initialTasks={tasks} initialEvents={events} agents={agents} templates={templates} />;
}
