{% extends "base.html" %}

{% block title %}{{ dataset.name }} - RAGLint{% endblock %}

{% block content %}
<div class="space-y-6">
    <div class="flex justify-between items-center">
        <div>
            <div class="flex items-center space-x-2">
                <a href="/datasets" class="text-sm text-gray-500 hover:text-gray-700">Datasets</a>
                <span class="text-gray-300">/</span>
                <h1 class="text-2xl font-bold text-gray-900">{{ dataset.name }}</h1>
            </div>
            <p class="mt-1 text-sm text-gray-500">{{ dataset.description }}</p>
        </div>
        <span class="text-sm text-gray-500">{{ items|length }} items</span>
    </div>

    <!-- Items Table -->
    <div class="flex flex-col">
        <div class="-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
            <div class="py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8">
                <div class="shadow overflow-hidden border-b border-gray-200 sm:rounded-lg">
                    <table class="min-w-full divide-y divide-gray-200">
                        <thead class="bg-gray-50">
                            <tr>
                                <th scope="col"
                                    class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
                                    Data
                                </th>
                            </tr>
                        </thead>
                        <tbody class="bg-white divide-y divide-gray-200">
                            {% for item in items %}
                            <tr>
                                <td class="px-6 py-4 text-sm text-gray-900">
                                    <pre
                                        class="bg-gray-50 p-2 rounded text-xs overflow-x-auto">{{ item.data | tojson(indent=2) }}</pre>
                                </td>
                            </tr>
                            {% endfor %}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}