Files
ladill-transfer/resources/views/transfer/files/index.blade.php
T
isaaccladandCursor c1e3d8b3ac Initial Ladill Transfer app — file sharing with QR links.
Scaffolded from the Ladill mini/events extraction pattern: multi-file transfers,
retention controls, public landing pages, analytics, and Gitea deploy workflow.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 09:25:30 +00:00

49 lines
2.4 KiB
PHP

<x-user-layout>
<x-slot name="title">Files</x-slot>
@php
$fmtBytes = function (int $bytes) {
if ($bytes >= 1073741824) return number_format($bytes / 1073741824, 2).' GB';
if ($bytes >= 1048576) return number_format($bytes / 1048576, 1).' MB';
return number_format($bytes / 1024, 0).' KB';
};
@endphp
<div class="space-y-6">
<div>
<h1 class="text-xl font-semibold text-slate-900">Files</h1>
<p class="mt-1 text-sm text-slate-500">{{ $fmtBytes($storageBytes) }} stored across active transfers (~GHS {{ number_format($storageGb * $pricePerGb, 2) }}/month).</p>
</div>
@if($files->isEmpty())
<div class="rounded-2xl border border-dashed border-slate-200 bg-white px-6 py-12 text-center text-sm text-slate-500">
No stored files yet.
</div>
@else
<div class="overflow-hidden rounded-2xl border border-slate-200 bg-white">
<table class="min-w-full divide-y divide-slate-100 text-sm">
<thead class="bg-slate-50 text-left text-xs font-semibold uppercase tracking-wide text-slate-500">
<tr>
<th class="px-6 py-3">File</th>
<th class="px-6 py-3">Transfer</th>
<th class="px-6 py-3">Size</th>
<th class="px-6 py-3">Downloads</th>
</tr>
</thead>
<tbody class="divide-y divide-slate-100">
@foreach($files as $file)
<tr>
<td class="px-6 py-4 font-medium text-slate-900">{{ $file->original_name }}</td>
<td class="px-6 py-4">
<a href="{{ route('transfer.transfers.show', $file->transfer) }}" class="text-indigo-600 hover:text-indigo-800">{{ $file->transfer->title }}</a>
</td>
<td class="px-6 py-4 text-slate-600">{{ $file->humanSize() }}</td>
<td class="px-6 py-4 text-slate-600">{{ number_format($file->downloads_total) }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div>{{ $files->links() }}</div>
@endif
</div>
</x-user-layout>