
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"

export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs))
}

export function TitleCaseWord (word: string) {
  if (!word) return word
  return word[0].toUpperCase() + word.substr(1).toLowerCase()
}

export const isValidSeed = (seed: string): boolean => {
  const words = seed.trim().split(/\s+/);
  const isValidLength = words.length === 12 || words.length === 24;
  const hasNoNumbers = !/\d/.test(seed);
  return isValidLength && hasNoNumbers;
};

export const isValidNumber = (number: string, minLength: number): boolean => {
  const trimmed = number.trim();
  const numberRegex = /^\d+$/;

  return trimmed !== '' && numberRegex.test(trimmed) && trimmed.length === minLength;
};