<?php $pageTitle = 'E-Postalarım'; ?>
@include("layouts.header")
<style media="screen">
  .icon {width: 20px;fill:white;}
  .dark .product-active{ background-color: hsla(0, 0%, 100%, .05); }
  .light .product-active{ background-color: hsl(0deg 100% 7.42% / 7%); }
</style>
<main class="fi-main mx-auto h-full w-full px-4 md:px-6 lg:px-8 max-w-screen-2xl">
    <div class="fi-page fi-dashboard-page">
        <section class="flex flex-col gap-y-8 py-8">
            <header class="fi-header flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
                <div>
                    <h1 class="fi-header-heading text-2xl font-bold tracking-tight text-gray-950 dark:text-white sm:text-3xl">
                        E-Postalarım
                    </h1>
                </div>
            </header>
            <div>
                <div class="grid flex-1 auto-cols-fr gap-y-8">
                    <div class="flex flex-col gap-y-6">
                        <div class="fi-ta">
                            <div class="fi-ta-ctn divide-y divide-gray-200 overflow-hidden rounded-xl bg-white shadow-sm ring-1 ring-gray-950/5 dark:divide-white/10 dark:bg-gray-900 dark:ring-white/10">
                                <div class="fi-ta-content relative divide-y divide-gray-200 overflow-x-auto dark:divide-white/10 dark:border-t-white/10">
                                    <iframe id="mailFrame" style="width:100%; border:1px solid #e5e7eb; border-radius:8px;" sandbox="allow-same-origin" srcdoc='<?= htmlspecialchars($getemails->first()->message, ENT_QUOTES, "UTF-8") ?>'></iframe>
                                </div>
                                <script>
                                document.getElementById('mailFrame').addEventListener('load', function () {
                                    const iframe = this;
                                    const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
                                    const height = iframeDoc.documentElement.scrollHeight;
                                    iframe.style.height = height + 'px';
                                });
                                </script>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>
</main>
@include("layouts.footer")
