@extends('admin.layouts.app')
@section('title', 'Edit Version - ' . $product->name)
@section('content')
<div class="card" style="max-width:600px">
    <div class="card-header">Edit Version: {{ $productVersion->version }}</div>
    <form action="{{ route('admin.products.versions.update', [$product, $productVersion]) }}" method="POST">
        @csrf @method('PUT')
        <div class="form-group">
            <label>Version *</label>
            <input type="text" name="version" class="form-control" value="{{ old('version', $productVersion->version) }}" required>
        </div>
        <div class="form-row">
            <div class="form-group">
                <label>Price ($) *</label>
                <input type="number" step="0.01" name="price" class="form-control" value="{{ old('price', $productVersion->price) }}" required>
            </div>
            <div class="form-group">
                <label>Sale Price ($)</label>
                <input type="number" step="0.01" name="sale_price" class="form-control" value="{{ old('sale_price', $productVersion->sale_price) }}">
            </div>
        </div>
        <div class="form-row">
            <div class="form-group">
                <label>Order</label>
                <input type="number" name="order" class="form-control" value="{{ old('order', $productVersion->order) }}" min="0">
            </div>
            <div class="form-group" style="padding-top:25px">
                <label class="checkbox-label"><input type="checkbox" name="is_active" value="1" {{ $productVersion->is_active ? 'checked' : '' }}> Active</label>
            </div>
        </div>
        <button type="submit" class="btn btn-primary">Update Version</button>
        <a href="{{ route('admin.products.versions.index', $product) }}" class="btn" style="background:#2a2a3e;color:#e0e0e0">Cancel</a>
    </form>
</div>
@endsection
