'use client';

import React from 'react';
import type { DashboardViewData } from '@/templates/view-data/DashboardViewData';
import type { DashboardPageDto } from '@/lib/page-queries/page-dtos/DashboardPageDto';
import { DashboardPresenter } from '@/lib/presenters/DashboardPresenter';
import { DashboardTemplate } from '@/templates/DashboardTemplate';

interface DashboardPageClientProps {
  pageDto: DashboardPageDto;
}

/**
 * Dashboard Page Client Component
 *
 * Uses Presenter to transform Page DTO into ViewData
 * Presenter is deterministic and side-effect free
 */
export function DashboardPageClient({ pageDto }: DashboardPageClientProps) {
  const viewData: DashboardViewData = DashboardPresenter.createViewData(pageDto);

  return <DashboardTemplate data={viewData} />;
}
