<?php
// @codingStandardsIgnoreFile

/* @var $block \Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Cart */
/* @var \Magento\Wishlist\Model\Item $item */
$item = $block->getItem();
$product = $item->getProduct();
?>
<?php foreach ($block->getChildNames() as $childName): ?>
    <?php /* @escapeNotVerified */
    echo $block->getLayout()->renderElement($childName, false); ?>
<?php endforeach; ?>

<div class="cs-grid-product__buttons">

<?php if ($product->isSaleable()): ?>
    <button
        type="button"
        data-role="tocart"
        data-post='<?php /* @escapeNotVerified */echo $block->getItemAddToCartParams($item) ?>'
        title="<?php /* @escapeNotVerified */echo __('Add to Cart') ?>"
        data-item-id="<?php /* @escapeNotVerified */echo $item->getId() ?>"
        class="cs-button cs-button--look_default cs-button--type_wide cs-button--size_300"
    >
        <span class="cs-button__span"><?php /* @escapeNotVerified */ echo __('Add to Cart') ?>
        <svg class="cs-button__icon">
            <use xlink:href="#arrow_next"></use>
        </svg>
    </button>
</div>
<?php else: ?>
    <?php if ($product->getIsSalable()): ?>
        <p class="cs-grid-product__stock" title="<?php /* @escapeNotVerified */echo __('Availability') ?>">
            <span class="cs-t-text cs-t-text--look_success">
                <?php /* @escapeNotVerified */echo __('In stock') ?>
            </span>
        </p>
    <?php else: ?>
        <p class="cs-grid-product__stock" title="<?php /* @escapeNotVerified */echo __('Availability') ?>">
            <span class="cs-t-text cs-t-text--look_error">
                <?php /* @escapeNotVerified */echo __('Out of stock') ?>
            </span>
        </p>
    <?php endif; ?>
<?php endif; ?>

