<?php

namespace MintyPHP\Support;

class Tile
{
    public static function render(array $options = []): void
    {
        $defaults = [
            'href' => '#',
            'label' => '',
            'count' => null,
            'icon' => 'bi bi-grid-1x2',
            'iconBg' => null,
            'iconColor' => null,
            'class' => '',
            'tooltip' => '',
            'tooltipPos' => 'top',
        ];

        $data = array_merge($defaults, $options);
        $template = dirname(__DIR__, 2) . '/templates/partials/app-tile.phtml';
        if (!is_file($template)) {
            return;
        }

        extract($data, EXTR_SKIP);
        require $template;
    }
}
