<?php
/**
 * Hyvä Themes - https://hyva.io
 * Copyright © Hyvä Themes 2020-present. All rights reserved.
 * This product is licensed per Magento install
 * See https://hyva.io/license
 */

/** @var \Magento\Customer\Block\Account\Dashboard\Info $block */
/** @var \Magento\Framework\Escaper $escaper */
?>
<div class="mb-6 text-2xl block-title"><?= $escaper->escapeHtml(__('Account Information')) ?></div>
<div class="flex flex-wrap justify-between -m-4">
    <div class="w-full p-4 lg:w-1/2">
        <div class="flex flex-col h-full p-8 sm:flex-row card">
            <div
                class="inline-flex items-center justify-center flex-shrink-0 w-16 h-16 mb-4
                    rounded-full sm:mr-8 sm:mb-0 bg-container-darker text-secondary">
                <svg class="w-8 h-8 fill-current" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
                    <path class="path1"
                          d="M486.4 563.2c-155.275 0-281.6-126.325-281.6-281.6s126.325-281.6 281.6-281.6
                          281.6 126.325 281.6 281.6-126.325 281.6-281.6 281.6zM486.4 51.2c-127.043 0-230.4
                          103.357-230.4 230.4s103.357 230.4 230.4 230.4c127.042 0 230.4-103.357
                          230.4-230.4s-103.358-230.4-230.4-230.4z">
                    </path>
                    <path class="path2"
                          d="M896 1024h-819.2c-42.347 0-76.8-34.451-76.8-76.8 0-3.485 0.712-86.285
                          62.72-168.96 36.094-48.126 85.514-86.36 146.883-113.634 74.957-33.314
                          168.085-50.206 276.797-50.206 108.71 0 201.838 16.893 276.797 50.206
                          61.37 27.275 110.789 65.507 146.883 113.634 62.008 82.675 62.72 165.475
                          62.72 168.96 0 42.349-34.451 76.8-76.8 76.8zM486.4 665.6c-178.52 0-310.267
                          48.789-381 141.093-53.011 69.174-54.195 139.904-54.2 140.61 0 14.013
                          11.485 25.498 25.6 25.498h819.2c14.115 0 25.6-11.485
                    25.6-25.6-0.006-0.603-1.189-71.333-54.198-140.507-70.734-92.304-202.483-141.093-381.002-141.093z
                    "></path>
                </svg>
            </div>
            <div class="flex-grow"><h2 class="mb-3 text-lg font-medium text-gray-900 title-font">
                    <span><?= $escaper->escapeHtml(__('Contact Information')) ?></span></h2>
                <p>
                    <?= $escaper->escapeHtml($block->getName()) ?><br>
                    <?= ''//$escaper->escapeHtml($block->getCustomer()->getCompany()) ?><br>
                    <?= $escaper->escapeHtml($block->getCustomer()->getEmail()) ?><br>
                </p>
                <?= $block->getChildHtml('customer.account.dashboard.info.extra'); ?>
                <a
                    class="inline-flex items-center w-full mt-3 md:text-sm text-gray-500 hover:text-secondary-darker"
                    href="<?= $escaper->escapeUrl($block->getUrl('customer/account/edit')) ?>">
                    <span><?= $escaper->escapeHtml(__('Edit')) ?></span>
                    <svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
                         stroke-width="2" class="w-4 h-4 ml-2" viewBox="0 0 24 24">
                        <path d="M5 12h14M12 5l7 7-7 7"></path>
                    </svg>
                </a>
                <a
                    class="inline-flex items-center w-full md:text-sm text-gray-500 hover:text-secondary-darker"
                    href="<?= $escaper->escapeUrl($block->getChangePasswordUrl()) ?>" class="action change-password">
                    <?= $escaper->escapeHtml(__('Change Password')) ?>
                    <svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
                         stroke-width="2" class="w-4 h-4 ml-2" viewBox="0 0 24 24">
                        <path d="M5 12h14M12 5l7 7-7 7"></path>
                    </svg>
                </a>
            </div>
        </div>
    </div>
    <?php if ($block->isNewsletterEnabled()): ?>
        <div class="w-full p-4 lg:w-1/2">
            <div class="flex flex-col h-full p-8 border border-gray-200 sm:flex-row card">
                <div
                    class="inline-flex items-center justify-center flex-shrink-0 w-16 h-16 mb-4
                        rounded-full sm:mr-8 sm:mb-0 bg-container-darker text-secondary">
                    <svg class="w-8 h-8 fill-current" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
                        <path class="path1"
                              d="M896 307.2h-819.2c-42.347 0-76.8 34.453-76.8 76.8v460.8c0 42.349 34.453
                              76.8 76.8 76.8h819.2c42.349 0 76.8-34.451
                              76.8-76.8v-460.8c0-42.347-34.451-76.8-76.8-76.8zM896
                              358.4c1.514 0 2.99 0.158 4.434 0.411l-385.632 257.090c-14.862 9.907-41.938
                              9.907-56.802 0l-385.634-257.090c1.443-0.253 2.92-0.411 4.434-0.411h819.2zM896
                              870.4h-819.2c-14.115 0-25.6-11.485-25.6-25.6v-438.566l378.4 252.267c15.925
                              10.618 36.363 15.925 56.8 15.925s40.877-5.307
                              56.802-15.925l378.398-252.267v438.566c0 14.115-11.485 25.6-25.6 25.6z">

                        </path>
                    </svg>
                </div>
                <div class="flex-grow"><h2 class="mb-3 text-lg font-medium text-gray-900 title-font">
                        <span><?= $escaper->escapeHtml(__('Newsletters')) ?></span></h2>
                    <p>
                        <?php if ($block->getIsSubscribed()): ?>
                            <?= $escaper->escapeHtml(__('You are subscribed to "General Subscription".')) ?>
                        <?php else: ?>
                            <?= $escaper->escapeHtml(__('You aren\'t subscribed to our newsletter.')) ?>
                        <?php endif; ?>
                    </p>
                    <a
                        class="mt-3 w-full inline-flex items-center md:text-sm text-gray-500
                            hover:text-secondary-darker"
                        href="<?= $escaper->escapeUrl($block->getUrl('newsletter/manage')) ?>">
                        <span><?= $escaper->escapeHtml(__('Edit')) ?></span>
                        <svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
                             stroke-width="2" class="w-4 h-4 ml-2" viewBox="0 0 24 24">
                            <path d="M5 12h14M12 5l7 7-7 7"></path>
                        </svg>
                    </a>
                </div>
            </div>
        </div>
    <?php endif; ?>
</div>
