@extends('layouts.app')

@section('title', 'Edit Asset')

@section('container-class', 'ams-container--narrow')

@section('content')
    <x-page-header
        title="Edit Asset"
        :subtitle="$asset->asset_tag.' · '.$asset->name">
        <x-slot:breadcrumbs>
            <li class="breadcrumb-item"><a href="{{ route('assets.index') }}">Assets</a></li>
            <li class="breadcrumb-item"><a href="{{ route('assets.show', $asset) }}">{{ $asset->asset_tag }}</a></li>
            <li class="breadcrumb-item active" aria-current="page">Edit</li>
        </x-slot:breadcrumbs>
    </x-page-header>

    <div class="row">
        <div class="col-xl-9">
            <div class="card">
                <div class="card-body p-4">
                    <form method="POST" action="{{ route('assets.update', $asset) }}" novalidate>
                        @csrf
                        @method('PUT')

                        @include('assets._form', [
                            'asset' => $asset,
                            'editing' => true,
                            'categories' => $categories,
                            'locations' => $locations,
                            'teams' => $teams,
                            'manufacturerSuggestions' => $manufacturerSuggestions,
                            'vendorSuggestions' => $vendorSuggestions,
                        ])

                        <div class="ams-form-actions">
                            <button type="submit" class="btn btn-primary">
                                <i class="bi bi-check2" aria-hidden="true"></i>Save Changes
                            </button>
                            <a href="{{ route('assets.show', $asset) }}" class="btn btn-ghost">Cancel</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection
