import UserInfo from "@/components/main/UserInfo";
import { IProjectRequest } from "@/types/types";
import Link from "next/link";
import React from "react";

function ProjectRequests({
  projectRequests,
}: {
  projectRequests: IProjectRequest[];
}) {
  return (
    <>
      {projectRequests
        ? projectRequests.map((item: IProjectRequest) => {
            return (
              <Link key={item?._id} href={`/users/${item?.user?.user_name}`}>
                <div className="flex my-4">
                  <UserInfo
                    first_name={item?.user?.first_name}
                    is_verified={item?.user?.is_verified}
                    profile_image={item?.user?.profile_image}
                    user_level={item?.user?.user_level}
                    last_name={item?.user?.last_name}
                    user_name={item?.user?.user_name}
                  />
                </div>
              </Link>
            );
          })
        : ""}
    </>
  );
}

export default ProjectRequests;
