@extends('layouts.app')

@section('title', 'Asset Types')
@section('heading', 'Asset Types')

@section('content')
@include('settings.partials.back-to-home')
    <x-card>
        <div class="mb-4 flex justify-between items-center">
            <p class="text-slate-600">Types of assets (e.g. Laptop, Phone).</p>
            <a href="{{ route('asset-types.create') }}" class="inline-flex items-center rounded-lg bg-slate-800 px-4 py-2 text-sm font-medium text-white hover:bg-slate-700"><i class="bi bi-plus-lg me-1"></i>Add Asset Type</a>
        </div>
        <x-table>
            <x-slot name="head">
                <tr>
                    <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Name</th>
                    <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Description</th>
                </tr>
            </x-slot>
            @forelse($assetTypes as $at)
                <tr>
                    <td class="whitespace-nowrap px-4 py-3 text-sm text-slate-900">{{ $at->name }}</td>
                    <td class="px-4 py-3 text-sm text-slate-600">{{ $at->description ?? '—' }}</td>
                </tr>
            @empty
                <tr><td colspan="2" class="px-4 py-8 text-center text-sm text-slate-500">No asset types yet.</td></tr>
            @endforelse
        </x-table>
        @if($assetTypes->hasPages())<div class="mt-4">{{ $assetTypes->links() }}</div>@endif
    </x-card>
@endsection
