import type { AppSnapshot } from "../../../types/domain";
import type { BuildSuggestion } from "../../../types/domain";

interface UseBuildsViewModelInput {
  snapshot: AppSnapshot;
}

export interface BuildsViewModel {
  visibleBuilds: Array<{
    build: BuildSuggestion;
  }>;
}

export function useBuildsViewModel({ snapshot }: UseBuildsViewModelInput): BuildsViewModel {
  return {
    visibleBuilds: snapshot.builds.slice(0, 9).map((build) => ({ build })),
  };
}
