<?php

namespace GriffinForms\Admin\App\Html\Icons;

use GriffinForms\Traits\Singleton;

class InlineIcons extends \GriffinForms\Admin\App\Html\Format
{
    use Singleton;

    public function plusIcon($class = '') {
        $class_attr = 'gf-icon' . ($class ? ' ' . esc_attr($class) : '');
        echo '<svg class="' . esc_attr($class_attr) . '" viewBox="0 0 24 24">
                <path d="M12 5v14M5 12h14" />
              </svg>';
    }

    public function trashIcon($class = '') {
        $class_attr = 'gf-icon' . ($class ? ' ' . esc_attr($class) : '');
        echo '<svg class="' . esc_attr($class_attr) . '" viewBox="0 0 24 24">
                <path d="M3 6h18M8 6v12m8-12v12M5 6l1-2h12l1 2" />
              </svg>';
    }

    public function editIcon($class = '')
    {
        $class_attr = 'gf-icon gf-icon-edit-animate' . ($class ? ' ' . esc_attr($class) : '');
        echo '<svg class="' . esc_attr($class_attr) . '" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
                <path d="M4 20h4l11-11-4-4L4 16v4z" />
              </svg>';
    }

    public function folderIcon($class = '') {
        $class_attr = 'gf-icon' . ($class ? ' ' . esc_attr($class) : '');
        echo '<svg class="' . esc_attr($class_attr) . '" viewBox="0 0 24 24">
                <path d="M3 6h5l2 2h11v11H3z" />
              </svg>';
    }

    public function messageIcon($class = '') {
        $class_attr = 'gf-icon' . ($class ? ' ' . esc_attr($class) : '');
        echo '<svg class="' . esc_attr($class_attr) . '" viewBox="0 0 24 24">
                <path d="M4 4h16v12H5l-1 4z" />
              </svg>';
    }

    public function checkIcon($class = '') {
        $class_attr = 'gf-icon' . ($class ? ' ' . esc_attr($class) : '');
        echo '<svg class="' . esc_attr($class_attr) . '" viewBox="0 0 24 24">
                <path d="M5 13l4 4L19 7" />
              </svg>';
    }

    public function checkCircleIcon($class = '') {
        $class_attr = 'gf-icon' . ($class ? ' ' . esc_attr($class) : '');
        echo '<svg class="' . esc_attr($class_attr) . '" viewBox="0 0 24 24">
                <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" />
              </svg>';
    }

    public function getIcon($icon_name, $class = '')        
    {
        $method = $icon_name . 'Icon';
        if (method_exists($this, $method)) {
            return $this->$method($class);
        }
        return '';
    }

    public function __construct() {

    }
}