<?php
declare(strict_types=1);

/**
 * EnglishSpeak - Edit Sentence Set
 * File: teacher/sentence-sets/edit.php
 *
 * This page reuses the complete Sentence Set editor in create.php.
 */

$setId = max(0, (int)($_GET['id'] ?? $_POST['id'] ?? 0));

if ($setId <= 0) {
    http_response_code(400);
    exit('Invalid Sentence Set.');
}

/*
 * create.php already supports both creating and editing.
 * Preserve the selected ID so it loads the correct Sentence Set.
 */
$_GET['id'] = $setId;

require __DIR__ . '/create.php';
