<?= $this->include('/Styles/header'); ?>

<main class="p-6">
  <div class="bg-white shadow rounded-lg p-6">
    <h2 class="text-2xl font-bold mb-4">Edit Category</h2>

    <form action="<?= site_url('category/update/'.$category['id']) ?>" method="post" class="grid grid-cols-2 gap-4">
      <div>
        <label class="block font-semibold">Category Name</label>
        <input type="text" name="category_name" value="<?= $category['category_name'] ?>" class="w-full border p-2 rounded" required>
      </div>

      <div class="col-span-2">
        <label class="block font-semibold">Description</label>
        <textarea name="description" class="w-full border p-2 rounded"><?= $category['description'] ?></textarea>
      </div>

      <div class="col-span-2">
        <button class="bg-green-600 text-white px-4 py-2 rounded hover:bg-green-700">Update</button>
      </div>
    </form>
  </div>
</main>

<?= $this->include('/Styles/footer'); ?>
