export function slug(str: string): string {
  return str
    .normalize('NFD') // Normalize accented characters to decomposed form
    .replace(/[\u0300-\u036f]/g, '') // Remove diacritic marks (accents)
    .toLowerCase() // Convert to lowercase
    .replace(/[^a-z0-9\s-]/g, '') // Remove non-alphanumeric characters except spaces and hyphens
    .trim() // Remove leading and trailing spaces
    .replace(/\s+/g, '-') // Replace spaces with hyphens
    .replace(/-+/g, '-'); // Replace multiple hyphens with a single hyphen
}
