"use server";
import React from "react";
import { retrieveAccessObjects } from "@/apicalls/cookies/token";
import LoginSelectOccupantCard from "@/pages/LoginSelectOccupant/page";

const LoginOccupantPage: React.FC = async () => {
  const accessObject: any = await retrieveAccessObjects();
  return accessObject ? (
    <>
      <div className="absolute top-0 left-0 min-w-full min-h-full">
        <div className="rounded-sm border border-stroke bg-white shadow-default dark:border-strokedark dark:bg-boxdark">
          <div className="flex flex-wrap items-center">
            <LoginSelectOccupantCard
              availableOccupants={accessObject?.available_occupants}
            />
          </div>
        </div>
      </div>
    </>
  ) : (
    <>
      <h1>No register Occupant has found for this user</h1>
    </>
  );
};

export default LoginOccupantPage;
