@extends('admin.partials.master')
@section('admin_content')
<div class="row">
    <div class="col-md-8 offset-md-2">
        <div class="card">
            <div class="card-header">
                <h4>Edit Video</h4>
            </div>
            <div class="card-body">
                <form action="{{ route('admin.videos.update', $video->id) }}" method="POST" enctype="multipart/form-data">
                    @csrf
                    @method('PUT')

                    <div class="form-group">
                        <label>Video Title</label>
                        <input type="text" name="title" class="form-control" value="{{ $video->title }}" required>
                    </div>

                    <div class="form-group">
                        <label>Thumbnail</label><br>
                        <img src="{{ asset('public/' . $video->thumbnail) }}" width="100" class="mb-2">
                        <input type="file" name="thumbnail" class="form-control">
                    </div>

                    <div class="form-group">
                        <label>Video URL</label>
                        <input type="url" name="url" class="form-control" value="{{ $video->url }}" required>
                    </div>

                    <div class="form-group">
                        <label>Platform</label>
                        <select name="platform" class="form-control">
                            <option value="youtube" @if($video->platform == 'youtube') selected @endif>YouTube</option>
                            <option value="vimeo" @if($video->platform == 'vimeo') selected @endif>Vimeo</option>
                            <option value="other" @if($video->platform == 'other') selected @endif>Other</option>
                        </select>
                    </div>

                    <div class="form-group">
                        <label>Status</label>
                        <select name="status" class="form-control">
                            <option value="active" @if($video->status == 'active') selected @endif>Active</option>
                            <option value="inactive" @if($video->status == 'inactive') selected @endif>Inactive</option>
                        </select>
                    </div>

                    <button type="submit" class="btn btn-success">Update Video</button>
                </form>
            </div>
        </div>
    </div>
</div>
@endsection
