Custom post states

// custom post state
add_filter('display_post_states', 'theme_slug_custom_post_states');
function theme_slug_custom_post_states($states) {
    global $post;
    if( ('page' == get_post_type($post->ID) ) && get_page_template_slug( $post->ID ) ) {
		$templates = get_page_templates();
		if( empty( $templates ) ){
			return $states;
		}
		$template_slug = get_page_template_slug( $post->ID );
		foreach ( $templates as $key => $value ) {
			if ( $value == $template_slug ){
				$states[] = "<small>" . $key . " template</small>";
			}
		}
    }
    return $states;
}