import { User } from "@/types";
import { PropsWithChildren } from "react";
import { ChevronLeft, ChevronRight, Folder } from "react-feather";
import PinnedProjectDetails from "./PinnedProjectDetails";

export default function PinnedProjects({ user }: PropsWithChildren<{ user: User }>) {
    const thisUser = user;

    const renderPinnedProjectsContent = () => {
        switch (thisUser.role_id) {
            case 1:
                return null;
            case 2:
                return (
                    <div className="w-full h-full">
                        <div className="flex justify-between items-center">
                            <p className="font-semibold text-md flex items-center p-0">Pinned Projects</p>
                            <div className="btn btn-link text-success-main p-0"><Folder size={20} />Manage pinned projects</div>
                        </div>
                        <div className="divider m-0"></div>
                        <PinnedProjectDetails user={thisUser} />
                    </div>
                );
            case 3:
                return (
                    <div className="w-full h-full">
                        <div className="flex justify-between items-center">
                            <p className="font-semibold text-md flex items-center p-0">Pinned Projects</p>
                            <div className="btn btn-link text-success-main p-0"><Folder size={20} />View all projects</div>
                        </div>
                        <div className="divider m-0"></div>
                        <PinnedProjectDetails user={thisUser} />
                    </div>
                );
            default:
                return null;
        }
    }

    return (
        <div className="h-full w-full px-2">
            {renderPinnedProjectsContent()}
        </div>
    );
}