@extends('layouts.dashboard') @section('title', __('AI Course Builder')) @section('page_title', __('AI Course Builder')) @section('content')
{{ __('Build a course from one prompt') }}
{{ $limit > 0 ? __(':remaining of :limit AI credits left this month', ['remaining' => $remaining, 'limit' => $limit]) : __('Unlimited AI credits') }} · {{ __('Title, copy, outcomes and the full curriculum are drafted for you — nothing is published until you say so.') }}
{{ __('AI Studio') }}
@unless($configured)
{{ __('AI is not configured yet. An administrator needs to add an API key under Admin → AI Settings.') }} {{ __('See a sample draft') }}
@endunless
{{ __('Describe the course') }}
@csrf
@error('prompt')
{{ $message }}
@enderror
@if($preview)
@csrf
{{ __('Course details') }} — {{ __('edit anything before creating') }}
@if($preview['category'] && !$categories->contains(fn ($c) => strcasecmp($c->name, $preview['category']) === 0))
{{ __('AI suggested “:c” — pick the closest.', ['c' => $preview['category']]) }}
@endif
{{ __('Curriculum') }} — {{ count($preview['sections']) }} {{ __('sections') }}, {{ collect($preview['sections'])->sum(fn ($s) => count($s['lessons'] ?? [])) }} {{ __('lessons') }}
@foreach($preview['sections'] as $i => $s)
{{ $i + 1 }}. {{ $s['title'] }}
{{ $s['description'] ?? '' }}
    @foreach($s['lessons'] ?? [] as $l)
  • {{ status_label($l['type'] ?? 'text') }}{{ $l['title'] }} — {{ $l['summary'] ?? '' }} ({{ __(':count min', ['count' => $l['duration'] ?? 0]) }})
  • @endforeach
@endforeach
{{ __('Lesson summaries are saved as placeholder text; you add the video or write the content afterwards (the Lesson draft tab can write it for you).') }}
@else
{{ __('Your course draft appears here.') }}
{{ __('You will be able to edit every field and untick the curriculum before the course is created as a draft.') }}
@endif
@endsection