import Boards from "@/components/Boards";
import LoginView from "@/components/views/LoginView";
import { authOptions } from "@/lib/authOptions";
import { getServerSession } from "next-auth";
import Link from "next/link";
import { FiPlusCircle } from "react-icons/fi";


export default async function Home() {
  const session = await getServerSession(authOptions);
  if(!session){
    return(
      <LoginView/>
   );
  }
  return (
    <div>
      <h1 className="text-2xl mb-4">Your boards</h1>
      <Boards/>
      <div className="mt-4">
        <Link href={'/new-board'} className="p-2 bg-[#427D9D] text-sm text-white font-semibold rounded-md inline-flex">
          <p className="flex gap-2 items-center">Create new board <FiPlusCircle className="text-[18px] font-semibold"/></p>
        </Link> 
      </div>
    </div>
  );
}
