public function loadComponents (ComponentType $type) : array
    {
        $path = "{$this->templatesDir}/{$type->getDirectory()}";

        if (!is_dir($path) || !is_readable($path))
        {
            return [];
        }

        $finder = new Finder();
        $files = $finder
            ->files()
            ->in($path)
            ->depth("== 0")
            ->name("*.html.twig")
            ->sortByName();

        $result = [];

        foreach ($files as $file)
        {
            $component = new Component($file, $this->templatePrefix, $type);
            $result[$component->getKey()] = $component;
        }

        return $result;
    }