59 lines
2.8 KiB
PHP
59 lines
2.8 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('content')
|
|
<div class="max-w-4xl mx-auto">
|
|
<div class="flex items-center justify-between mb-6">
|
|
<h1 class="text-3xl font-bold text-indigo-700">My Summary Requests</h1>
|
|
<a href="{{ route('requests.create') }}" class="px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white rounded-md">New request</a>
|
|
</div>
|
|
|
|
@if (session('success'))
|
|
<div class="mb-4 rounded-md bg-green-50 border border-green-200 text-green-800 p-3">
|
|
{{ session('success') }}
|
|
</div>
|
|
@endif
|
|
|
|
@if($requests->count() === 0)
|
|
<div class="bg-white rounded-lg shadow p-6 text-center text-gray-600">
|
|
You haven't requested any summaries yet.
|
|
</div>
|
|
@else
|
|
<div class="bg-white rounded-lg shadow overflow-hidden">
|
|
<table class="min-w-full">
|
|
<thead class="bg-gray-50">
|
|
<tr class="text-left text-sm text-gray-600">
|
|
<th class="px-4 py-3">Gutenberg ID</th>
|
|
<th class="px-4 py-3">Title</th>
|
|
<th class="px-4 py-3">Status</th>
|
|
<th class="px-4 py-3">Requested</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-100">
|
|
@foreach($requests as $r)
|
|
<tr class="text-sm">
|
|
<td class="px-4 py-3">
|
|
<a href="https://www.gutenberg.org/ebooks/{{ $r->gutenberg_id }}" target="_blank" rel="noopener" class="text-indigo-600 hover:underline">{{ $r->gutenberg_id }}</a>
|
|
</td>
|
|
<td class="px-4 py-3">{{ $r->title ?? '—' }}</td>
|
|
<td class="px-4 py-3">
|
|
<span class="inline-flex items-center px-2 py-1 rounded text-xs {{ $r->status === 'pending' ? 'bg-yellow-50 text-yellow-800' : ($r->status === 'completed' ? 'bg-green-50 text-green-800' : 'bg-gray-100 text-gray-700') }}">{{ ucfirst($r->status) }}</span>
|
|
</td>
|
|
<td class="px-4 py-3 text-gray-500">{{ $r->created_at->diffForHumans() }}</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="mt-4">
|
|
{{ $requests->links() }}
|
|
</div>
|
|
@endif
|
|
|
|
<div class="mt-6 p-4 bg-indigo-50 border border-indigo-100 rounded-lg">
|
|
<p class="text-sm text-indigo-900">
|
|
Books featured on this site are sourced from <a href="https://www.gutenberg.org/" class="text-indigo-700 underline" target="_blank" rel="noopener">Project Gutenberg</a> and are part of the public domain. Summaries are generated using AI and may contain inaccuracies.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
@endsection
|