import type { Difficulty } from "@/types";

export function cn(...classes: (string | undefined | false)[]): string {
  return classes.filter(Boolean).join(" ");
}

export function getDifficultyVariant(
  difficulty: Difficulty
): "difficulty-easy" | "difficulty-medium" | "difficulty-hard" {
  switch (difficulty) {
    case "easy":
      return "difficulty-easy";
    case "medium":
      return "difficulty-medium";
    case "hard":
      return "difficulty-hard";
  }
}

export function getDifficultyLabel(difficulty: Difficulty): string {
  switch (difficulty) {
    case "easy":
      return "Easy difficulty";
    case "medium":
      return "Medium difficulty";
    case "hard":
      return "Hard difficulty";
  }
}

export function capitalize(str: string): string {
  return str.charAt(0).toUpperCase() + str.slice(1);
}
