<?php
require_once 'lib/backend.php';
try {
    $api = new Backend($_COOKIE['auth'] ?? '');
} catch (AuthException $e) {
    header('Location: /login.php');
    exit();
}
?>
<?php require_once 'parts/header.php' ?>
  <h3>Create a note</h3>
  <form action="/note.php" method="POST">
    <label for="title">Title</label>
    <input type="text" id="title" name="title" placeholder="Title" />
    <label for="content">Content</label>
    <textarea id="content" name="content" placeholder="Note content"></textarea>
    <div></div>
    <input type="submit" value="Create" />
  </form>
<?php require_once 'parts/footer.html' ?>

