<!DOCTYPE html>
<html lang="vi">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?php echo $__env->yieldContent('title', 'Kiểm tra Google Sheet'); ?> — <?php echo e(config('app.name')); ?></title>
    <script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-slate-50 text-slate-900 min-h-screen">
    <?php
        $googleUser = \App\Services\GoogleOAuthSession::user();
        $isLoggedIn = \App\Services\GoogleOAuthSession::isLoggedIn();
    ?>
    <header class="bg-white border-b border-slate-200">
        <div class="max-w-6xl mx-auto px-4 py-4 flex items-center justify-between gap-4">
            <a href="<?php echo e(route('sheets.index')); ?>" class="font-semibold text-lg text-indigo-700 shrink-0">
                <?php echo e(config('app.name', 'Check Google Sheet')); ?>

            </a>

            <?php if($isLoggedIn && $googleUser): ?>
                <div class="flex items-center gap-3 min-w-0">
                    <?php if(!empty($googleUser['picture'])): ?>
                        <img src="<?php echo e($googleUser['picture']); ?>" alt="" class="w-8 h-8 rounded-full border border-slate-200 shrink-0">
                    <?php endif; ?>
                    <span class="text-sm text-slate-600 truncate hidden sm:inline">
                        <?php echo e($googleUser['email']); ?>

                    </span>
                    <form method="POST" action="<?php echo e(route('google.oauth.logout')); ?>" class="shrink-0">
                        <?php echo csrf_field(); ?>
                        <button type="submit" class="text-sm text-slate-500 hover:text-red-600">Đăng xuất</button>
                    </form>
                </div>
            <?php else: ?>
                <a href="<?php echo e(route('google.oauth.redirect')); ?>" class="text-sm font-medium text-indigo-600 hover:text-indigo-800 shrink-0">
                    Đăng nhập Google
                </a>
            <?php endif; ?>
        </div>
    </header>

    <main class="max-w-6xl mx-auto px-4 py-8">
        <?php if(session('status')): ?>
            <div class="mb-6 rounded-lg bg-green-50 border border-green-200 text-green-800 px-4 py-3">
                <?php echo e(session('status')); ?>

            </div>
        <?php endif; ?>

        <?php if($errors->any()): ?>
            <div class="mb-6 rounded-lg bg-red-50 border border-red-200 text-red-800 px-4 py-3">
                <ul class="list-disc list-inside">
                    <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <li class="whitespace-pre-wrap"><?php echo e($error); ?></li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </ul>
            </div>
        <?php endif; ?>

        <?php echo $__env->yieldContent('content'); ?>
    </main>
</body>
</html>
<?php /**PATH /Users/nguyenminhkhang/JobOutSource/villa/check_gg_sheet/resources/views/layouts/app.blade.php ENDPATH**/ ?>