<?php

namespace Autogedal\Labels\Model\Config\Source;

use Magento\Framework\Data\OptionSourceInterface;
use Magento\Framework\UrlInterface;
use Magento\Store\Model\StoreManagerInterface;

class Shape implements OptionSourceInterface
{
    private $storeManager;

    public function __construct(StoreManagerInterface $storeManager)
    {
        $this->storeManager = $storeManager;
    }

    public function toOptionArray(): array
    {
        $mediaBaseUrl = $this->storeManager->getStore()->getBaseUrl(UrlInterface::URL_TYPE_MEDIA);

        return [
            ['value' => '', 'label' => __('Custom upload'), 'icon' => '', 'size' => 'small'],
            ['value' => 'circle.svg', 'label' => __('Circle'), 'icon' => $mediaBaseUrl . 'autogedal_label/circle.svg', 'size' => 'small'],
            ['value' => 'rquarter.svg', 'label' => __('Right Quarter'), 'icon' => $mediaBaseUrl . 'autogedal_label/rquarter.svg', 'size' => 'small'],
            ['value' => 'rbquarter.svg', 'label' => __('Right Bottom Quarter'), 'icon' => $mediaBaseUrl . 'autogedal_label/rbquarter.svg', 'size' => 'small'],
            ['value' => 'lquarter.svg', 'label' => __('Left Quarter'), 'icon' => $mediaBaseUrl . 'autogedal_label/lquarter.svg', 'size' => 'small'],
            ['value' => 'lbquarter.svg', 'label' => __('Left Bottom Quarter'), 'icon' => $mediaBaseUrl . 'autogedal_label/lbquarter.svg', 'size' => 'small'],
            ['value' => 'list.svg', 'label' => __('List'), 'icon' => $mediaBaseUrl . 'autogedal_label/list.svg', 'size' => 'small'],
            ['value' => 'note.svg', 'label' => __('Note'), 'icon' => $mediaBaseUrl . 'autogedal_label/note.svg', 'size' => 'small'],
            ['value' => 'flag.svg', 'label' => __('Flag'), 'icon' => $mediaBaseUrl . 'autogedal_label/flag.svg', 'size' => 'small'],
            ['value' => 'banner.svg', 'label' => __('Banner'), 'icon' => $mediaBaseUrl . 'autogedal_label/banner.svg', 'size' => 'small'],
            ['value' => 'tag.svg', 'label' => __('Tag'), 'icon' => $mediaBaseUrl . 'autogedal_label/tag.svg', 'size' => 'small'],
        ];
    }
}
