<?php
/**
 * @var Laminas\View\Renderer\PhpRenderer $this
 * @var \Tour\Entity\Team $team
 */
$this->headTitle('Modifier ' . $team->getName());
?>
<div class="page-title mt-3">
    <i class="bi bi-pencil"></i> Modifier : <?= $this->escapeHtml($team->getName()) ?>
</div>

<div class="row justify-content-center mt-3">
    <div class="col-md-5">
        <div class="card-app">
            <form method="post">
                <div class="mb-3">
                    <label for="name" class="form-label">Nom</label>
                    <input type="text" name="name" id="name" class="form-control" required value="<?= $this->escapeHtml($team->getName()) ?>">
                </div>
                <div class="mb-3">
                    <label for="color" class="form-label">Couleur</label>
                    <input type="color" name="color" id="color" class="form-control form-control-color" value="<?= $this->escapeHtml($team->getColor() ?? '#6366f1') ?>">
                </div>
                <div class="mb-3">
                    <label for="description" class="form-label">Description</label>
                    <textarea name="description" id="description" class="form-control" rows="2"><?= $this->escapeHtml($team->getDescription() ?? '') ?></textarea>
                </div>
                <div class="d-flex justify-content-between">
                    <a href="<?= $this->url('teams', ['action' => 'view', 'id' => $team->getId()]) ?>" class="btn btn-outline-secondary">Annuler</a>
                    <button type="submit" class="btn btn-app">Enregistrer</button>
                </div>
            </form>
        </div>
    </div>
</div>
