Posts page

// pages/admin/posts
import { useState, useEffect } from "react";
import AdminLayout from "../../../components/layout/AdminLayout";
import { Row, Col, Button } from "antd";
import { PlusOutlined } from "@ant-design/icons";
import Link from "next/link";

const Posts = () => {
  // state
  const [loading, setLoading] = useState(false);
  const [posts, setPosts] = useState([]);

  return (
    <AdminLayout>
      <Row>
        <Col span={24}>
          <Button
            type="primary"
            htmlType="submit"
            style={{ margin: "10px 0px 10px 0" }}
          >
            <Link href="/admin/posts/new">
              <a>
                <PlusOutlined /> Add New
              </a>
            </Link>
          </Button>
          <h1>Posts</h1>
        </Col>
      </Row>
    </AdminLayout>
  );
};

export default Posts;

Add new post page

// pages/admin/posts.new
import { useState, useEffect } from "react";
import AdminLayout from "../../../components/layout/AdminLayout";
import { Row, Col, Button } from "antd";
import { PlusOutlined } from "@ant-design/icons";

const NewPost = () => {
  // state
  const [loading, setLoading] = useState(false);

  return (
    <AdminLayout>
      <Row>
        <Col span={16}>
          <p>Create</p>
        </Col>
        <Col span={8}>
          <Button
            type="primary"
            htmlType="submit"
            style={{ margin: "10px 0px 10px 0" }}
            block
          >
            Publish
          </Button>
          <p>Sidebar options</p>
        </Col>
      </Row>
    </AdminLayout>
  );
};

export default NewPost;