from typing import Union
from typing import List
from typing import Dict
from typing import Any


def _build_component_dict_list_from_names(components: Union[List[str], List[Dict[str, Any]]]):
    """Turn component list into a dictionary list.

    >> _build_component_dict_list_from_names(['material', 'texture'])
    [{'name': 'material'}, {'name': 'texture'}]

    Returns:
        List of components dictionaries with at least a key
        ``name``.

    """
    component_dict_list = []
    for component in components:
        if isinstance(component, dict):
            component_dict_list.append(component)
        else:
            component_dict_list.append({'name': component})
    return component_dict_list