@include('admin.header') 

<div class="container">
           <div class="row mb-3">
            <div class="col-md-6">
    <h1>Accessories</h1>

            </div>
            <div class="col-md-6 text-right">
                       <a href="{{ route('admin.accessories.create') }}" class="btn btn-primary mb-3"><i class="fas fa-plus"></i>
 Add New Fabric Add-on</a>


            </div>
</div>
    @if (session("success"))
        <div class="alert alert-success">{{ session("success") }}</div>
    @endif
    <div class="card">
        <div class="card-body">
            <div class="table-responsive">
    <table class="table table-bordered">
        <thead class="text-white bg-dark">
            <tr>
                <th>ID</th>
                <th>Name</th>
                <th>Consumption per Unit</th>
                <th>Default Rate</th>
                <th>Unit</th>
                <th>Active</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
            @foreach ($accessories as $accessory)
                <tr>
                    <td>{{ $accessory->id }}</td>
                    <td>{{ $accessory->name }}</td>
                    <td>{{ $accessory->consumption_per_unit }}</td>
                    <td>{{ $accessory->default_rate }}</td>
                    <td>{{ $accessory->unit }}</td>
                    <td>{{ $accessory->is_active ? "Yes" : "No" }}</td>
                    <td>
                    
                        <a href="{{ route('admin.accessories.edit', $accessory->id) }}" class="btn btn-primary btn-sm"><i class="fas fa-edit"></i> Update</a>
                        <form action="{{ route('admin.accessories.destroy', $accessory->id) }}" method="POST" style="display:inline-block;">
                            @csrf
                            @method("DELETE")
                            <button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('Are you sure?')"><i class="fas fa-trash"></i> Remove</button>
                        </form>
                    </td>
                </tr>
            @endforeach
        </tbody>
    </table>
</div>
</div>
</div>
</div>
@include('admin.footer') 


