import { useState, useEffect } from "react";
import { API_URL } from "./constants";

export function BlogList() {
  const [content, setContent] = useState("");
  useEffect(() => {
    fetch(`${API_URL}/get-blogs`, {
      method: "GET",
      headers: {
        "Content-Type": "application/json",
      },
    })
      .then((res) => res.text())
      .then(setContent);
  }, []);

  return <div>{content}</div>;
}
