Display the number of WooCommerce items per user in User list custom column

I work on a WordPress website with WooCommerce plugin.

My question:

How to add a new column in User table displaying the number of items. Each customer has items in his/her inventory. I want to count and display the number in the User table in Wordpress.

Here an example on how to display a new column, ‘Billing country’, in Wordpress User table:

add_filter( 'manage_users_columns', 'rrr_add_new_user_column' );
function rrr_add_new_user_column( $columns ) {
    $columns['billing_country'] = 'Billing Country';
    return $columns;
}
 
add_filter( 'manage_users_custom_column', 'rrr_add_new_user_column_content', 10, 3 );
function rrr_add_new_user_column_content( $content, $column, $user_id ) {
    if ( 'billing_country' === $column ) {
        $customer = new WC_Customer( $user_id );
        $content = $customer->get_billing_country();
    }
    return $content;
}

I tried to replace the variable ‘billing_country’ with ‘items’ or ‘inventory’ but it does not work.

add_filter( 'manage_users_columns', 'add_items_count_column' );
function add_items_count_column( $columns ) {
    $columns['items_count'] = 'Items Count';
    return $columns;
}

Display the Number of Items in the New Column

add_filter( 'manage_users_custom_column', 'add_items_count_column_content', 10, 3 );
function add_items_count_column_content( $content, $column, $user_id ) {
    if ( 'items_count' === $column ) {
        $items_count = get_customer_items_count( $user_id );
        $content = $items_count;
    }
    return $content;
}

Function to Get the Number of Items

This function calculates the total number of items in all completed orders for a specific customer:

function get_customer_items_count( $user_id ) {
    $args = array(
        'customer_id' => $user_id,
        'status'      => 'completed', // You can change the status to other order statuses if needed
        'limit'       => -1 // Retrieve all orders
    );
    
    $orders = wc_get_orders( $args );
    $items_count = 0;
    
    foreach ( $orders as $order ) {
        foreach ( $order->get_items() as $item ) {
            $items_count += $item->get_quantity(); // Get the quantity of each item
        }
    }
    
    return $items_count;
}