<flux:main>
    <flux:heading size="xl" level="1">Haloo, {{ auth()->user()?->customer?->name }}</flux:heading>
    <flux:text class="mb-6 mt-2 text-base">Selamat datang di Studio Yadi Parfum.</flux:text>
    <flux:separator variant="subtle" />

    <div class="mt-6 grid grid-cols-1 md:grid-cols-2 gap-4">
        <flux:callout icon="user-group" color="blue">
            <flux:callout.heading>
                {{ auth()->user()?->membership?->tier?->name }}
                <flux:badge color="emerald" size="sm" inset="top bottom">
                    {{ auth()->user()?->membership?->total_points }} Poin</flux:badge>
            </flux:callout.heading>

            <flux:callout.text>
                <p>Undang teman dan dapatkan hadiah menarik!</p>
            </flux:callout.text>

            <x-slot name="actions">
                <flux:button>Undang teman</flux:button>
                <flux:button>Ambil Hadiah</flux:button>
            </x-slot>
        </flux:callout>

        <flux:callout icon="magnifying-glass" color="emerald">
            <flux:callout.heading>Jelajahi Produk Kami</flux:callout.heading>

            <flux:callout.text>
                Coba dan rasakan manfaat menggunakanan yadi parfum.
            </flux:callout.text>

            <x-slot name="actions">
                <flux:button>Jelajahi</flux:button>
                <flux:button
                    href="https://wa.me/62895405946991?text=Halo%2C%20saya%20mau%20tanya%20tentang%20produk%20Anda">
                    Tanya Ahli</flux:button>
            </x-slot>
        </flux:callout>

        @if (!$isVerified)
            <div wire:poll.3s="checkEmailVerification">
                <flux:callout icon="envelope" color="rose" inline>
                    <flux:callout.heading> Silakan verifikasi email Anda agar bisa menikmati seluruh fitur kami.
                    </flux:callout.heading>

                    <x-slot name="actions">
                        <flux:button x-data
                            x-on:click.prevent="
                        if (/Android|iPhone|iPad|iPod/i.test(navigator.userAgent)) {
                            window.location.href = 'intent://mail.google.com/#Intent;scheme=https;package=com.google.android.gm;end';
                        } else {
                            window.open('https://mail.google.com', '_blank');
                        }
                    ">
                            Verifikasi →
                        </flux:button>
                    </x-slot>
                </flux:callout>
            </div>
        @endif

        <flux:callout icon="star" color="purple" inline>
            <flux:callout.heading> Temukan keuntungan eksklusif dan manfaat spesial sebagai member.
            </flux:callout.heading>

            <x-slot name="actions">
                <flux:button>Lihat</flux:button>
            </x-slot>
        </flux:callout>

    </div>
</flux:main>
