import type {
  CircleSectorData,
  CircleSectorProgress,
} from "@/pages/learningPath/learningPathPage/LearningPathCircle.vue";
import type { Circle } from "@/services/circle";

export function calculateCircleSectorData(circle: Circle): CircleSectorData[] {
  return circle.learningSequences.map((ls) => {
    let progress: CircleSectorProgress = "none";
    if (circle.allFinishedInLearningSequence(ls.translation_key)) {
      progress = "finished";
    } else if (circle.someFinishedInLearningSequence(ls.translation_key)) {
      progress = "in_progress";
    }
    return {
      progress: progress,
    };
  });
}
