/**
 * Dashboard Summary Hook
 * Provides dashboard data with proper error handling, caching, and loading states
 */

import type { DashboardSummary } from "@customer-portal/domain/dashboard";
import { useMeStatus } from "./useMeStatus";

/**
 * Hook for fetching dashboard summary data
 */
export function useDashboardSummary() {
  const status = useMeStatus();

  return {
    data: (status.data?.summary ?? undefined) as DashboardSummary | undefined,
    isLoading: status.isLoading,
    isError: status.isError,
    error: status.error,
    refetch: status.refetch,
  };
}
