Help with CPT template pagination

there is no need to handle the pagination like this:

$paged = get_query_var( 'paged', 1 );

Just put this after the loop:

get_the_posts_pagination(
    'mid_size'              => 1,
    'prev_text'             => ' ',
    'next_text'             => ' ',
    'screen_reader_text'    => 'A'
)

like this:

if( have_posts() ){
    while( have_posts() ){
        the_post();?>
        the_content();?>
    <?php }
    echo get_the_posts_pagination(
        'mid_size'              => 1,
        'prev_text'             => '&nbsp;',
        'next_text'             => '&nbsp;',
        'screen_reader_text'    => 'A'
    );
    wp_reset_postdata();
}?>