import { CampaignsManagementBoard } from '../../../components/campaigns-management-board';
import { DashboardShell } from '../../../components/dashboard-shell';
import { requireAuthToken } from '../../../lib/auth';
import { fetchCampaigns } from '../../../lib/api';

export default async function CampaignsPage() {
  const token = await requireAuthToken();
  const campaignsData = await fetchCampaigns(token);

  return (
    <DashboardShell currentPath="/dashboard/campaigns">
      <CampaignsManagementBoard campaigns={campaignsData.items} metrics={campaignsData.metrics} />
    </DashboardShell>
  );
}
