<?php
/**
 * Maho
 *
 * @category    design
 * @package     rwd_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
 * @copyright   Copyright (c) 2021-2022 The OpenMage Contributors (https://openmage.org)
 * @copyright   Copyright (c) 2024 Maho (https://mahocommerce.com)
 * @license     https://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

/** @var Mage_ConfigurableSwatches_Block_Catalog_Layer_State_Swatch $this */
?>
<?php
$_filter = $this->getFilter();
$_label = $this->stripTags($_filter->getLabel());

$_swatchInnerWidth = $this->getSwatchInnerWidth();
$_swatchInnerHeight = $this->getSwatchInnerHeight();
$_swatchOuterWidth = $this->getSwatchOuterWidth();
$_swatchOuterHeight = $this->getSwatchOuterHeight();

$_lineHeight = $_swatchOuterHeight + 2;

$_swatchUrl = $this->getSwatchUrl();
?>

<li class="swatch-current">
    <?php
    $clearLinkUrl = $_filter->getClearLinkUrl();
    if ($clearLinkUrl):
        ?>
        <a  class="btn-previous" href="<?= $_filter->getRemoveUrl() ?>" title="<?= Mage::helper('core')->quoteEscape($this->__('Previous')) ?>"><?= $this->__('Previous') ?></a>
        <a  class="btn-remove" title="<?= $this->escapeHtml($_filter->getFilter()->getClearLinkText()) ?>" href="<?= $clearLinkUrl ?>"><?= $this->escapeHtml($_filter->getFilter()->getClearLinkText()) ?></a>
    <?php else: ?>
        <a  class="btn-remove" href="<?= $_filter->getRemoveUrl() ?>" title="<?= Mage::helper('core')->quoteEscape($this->__('Remove This Item')) ?>"><?= $this->__('Remove This Item') ?></a>
    <?php endif ?>
    <span class="label" style="line-height: <?= $_lineHeight ?>px;"><?= $this->__($_filter->getName()) ?>:</span>
    <span class="value" style="line-height: <?= $_lineHeight ?>px;">
        <span class="swatch-link" style="height:<?= $_swatchOuterHeight ?>px; width:<?= $_swatchOuterWidth ?>px;">
            <span class="swatch-label" style="height:<?= $_swatchInnerHeight ?>px; width:<?= $_swatchInnerWidth ?>px; line-height:<?= $_swatchInnerHeight ?>px;">
                <img src="<?= $_swatchUrl ?>" alt="<?= $_label ?>" title="<?= $_label ?>" width="<?= $_swatchInnerWidth ?>" height="<?= $_swatchInnerHeight ?>" />
            </span>
        </span>
    </span>
</li>
