<?php


namespace App\Components\Carousel;


use App\Model\Facades\SiteFacade;
use Nette\Application\UI\Control;
use WebChemistry\Images\AbstractStorage;

class Carousel extends Control
{
    /** @var AbstractStorage  */
    protected $imageStorage;
    /** @var SiteFacade */
    protected $siteFacade;

    public function __construct(AbstractStorage $imageStorage, SiteFacade $siteFacade)
    {
        parent::__construct();

        $this->imageStorage = $imageStorage;
        $this->siteFacade = $siteFacade;
    }

    public function render($id = null)
    {
        if ($id === null) {
            return;
        }

        $template = $this->template;
        $template->imageStorage = $this->imageStorage;
        $template->setFile(__DIR__ . '/templates/carousel.latte');
        $template->render();
    }

}