// Utility function to get unit ID for sorting
export const getUnitId = (unitName: string): number => {
  if (unitName === 'Naval Headquarters') return 1;
  if (unitName === 'Dhaka Naval Area') return 2;
  if (unitName === 'Chittagong Naval Area') return 3;
  if (unitName === 'Khulna Naval Area') return 4;
  // For other units, try to extract number from name or use alphabetical
  const match = unitName.match(/(\d+)/);
  return match ? parseInt(match[1]) : 999;
};

// Sort units by ID
export const sortUnitsById = (units: string[]): string[] => {
  return units.sort((a, b) => getUnitId(a) - getUnitId(b));
};
