protected function buildMediaTypeMenu(MediaLibraryState
$state) { // Add the menu for each type if we have more than 1 media type enabled for
// the field.
$allowed_type_ids =
$state->
getAllowedTypeIds();
if (count($allowed_type_ids) <= 1
) { return [];
} // @todo Add a class to the li element.
// https://www.drupal.org/project/drupal/issues/3029227
$menu =
[ '#theme' => 'links__media_library_menu',
'#links' =>
[],
'#attributes' =>
[ 'class' =>
['js-media-library-menu'
],
],