@extends('admin.layout')

@section('title', 'Import ' . ucfirst($kind))
@section('heading', 'Import ' . ucfirst($kind))

@section('content')
    <form
        class="panel import-box"
        method="post"
        action="{{ route('admin.' . $kind . 's.import') }}"
    >
        @csrf

        <h2>Import from TMDB or IMDb</h2>

        <p>
            Paste a full TMDB {{ $kind === 'movie' ? 'movie' : 'TV-show' }} link, a TMDB numeric ID,
            or an IMDb ID. The title, metadata, official trailer reference, poster and backdrop will be imported.
        </p>

        <label for="reference">TMDB Link / TMDB ID / IMDb ID</label>
        <input
            id="reference"
            name="reference"
            value="{{ old('reference') }}"
            placeholder="{{ $kind === 'movie' ? 'https://www.themoviedb.org/movie/1475803-governor' : 'https://www.themoviedb.org/tv/12345-show-name' }}"
            required
            autocomplete="off"
        >

        @error('reference')
            <div class="alert error">{{ $message }}</div>
        @enderror

        <div class="import-examples">
            <strong>Accepted examples:</strong>
            <code>https://www.themoviedb.org/{{ $kind === 'movie' ? 'movie' : 'tv' }}/123456-title</code>
            <code>123456</code>
            <code>tt0111161</code>
        </div>

        <button class="primary" type="submit">
            <i class="fa-solid fa-cloud-arrow-down"></i>
            Fetch &amp; Import
        </button>
    </form>
@endsection
