<!-- views/edit-key.ejs -->

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Cambopay SMS API Key</title>
  <link rel="icon" type="image/png" href="/css/Icon Logo.png">
  <link rel="stylesheet" href="/css/style.css">
  <style>
    h1 {
      text-align: center;
      margin-top: 20px;
      color: #004466;
    }

    form {
      background-color: #fff;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
      border-radius: 8px;
      overflow: hidden;
      width: 300px;
      padding: 20px;
      margin: 20px auto;
    }

    form label {
      display: block;
      margin-bottom: 8px;
      color: #333;
    }

    form input {
      width: 100%;
      padding: 10px;
      border: 1px solid #ccc;
      border-radius: 4px;
      box-sizing: border-box;
      margin-bottom: 16px;
    }

    form button {
      background-color: #004466;
      color: white;
      padding: 10px;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      width: 100%;
    }

    form button:hover {
      background-color: #002233;
    }
  </style>
</head>
<body>
  <nav class="navbar">
    <ul>
      <li><a href="/generate-key">Generate Key</a></li>
      <li><a href="/api-keys">View API Key</a></li>
      <li><a href="/create-user">Create User</a></li>
      <li><a href="/view-users">View Users</a></li>
      <li class="logout"><a href="/logout">Logout</a></li>
    </ul>
  </nav>

  <h1>Edit API Key</h1>

  <form action="/edit-api-key/<%= apiKey._id %>" method="post">
    <label for="name">API Name:</label>
    <input type="text" name="name" value="<%= apiKey.name %>" required>
    <br>
    <button type="submit">Save Changes</button>
  </form>
</body>
</html>
