Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
AryanGKulkarni committed Mar 31, 2024
2 parents 4d86094 + 892ba5a commit e53f247
Show file tree
Hide file tree
Showing 44 changed files with 7,273 additions and 2,378 deletions.
5 changes: 4 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
env: {
NEXT_PUBLIC_BACKEND_URL: process.env.NEXT_PUBLIC_BACKEND_URL,
},
reactStrictMode: false,
images: {
domains: ["localhost"],
},
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@radix-ui/react-toast": "^1.1.5",
"@reduxjs/toolkit": "^2.0.1",
"@tanstack/react-table": "^8.11.2",
"@types/qs": "^6.9.14",
"antd": "^5.13.1",
"axios": "^1.6.3",
"class-variance-authority": "^0.7.0",
Expand All @@ -41,6 +42,7 @@
"papaparse": "^5.4.1",
"pdf-lib": "^1.17.1",
"prettier": "^3.1.1",
"qs": "^6.12.0",
"react": "latest",
"react-dom": "latest",
"react-google-button": "^0.7.2",
Expand Down
24 changes: 12 additions & 12 deletions src/app/(routes)/admin/JAF/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import Loading from "@/components/common/loading";
import { Suspense } from "react";

interface Props {
children: React.ReactNode;
}

const JAFLayout = ({ children }: Props) => {
return <Suspense fallback={<Loading />}>{children}</Suspense>;
};

export default JAFLayout;
import Loading from "@/components/common/loading";
import { Suspense } from "react";

interface Props {
children: React.ReactNode;
}

const JAFLayout = ({ children }: Props) => {
return <Suspense fallback={<Loading />}>{children}</Suspense>;
};

export default JAFLayout;
30 changes: 15 additions & 15 deletions src/app/(routes)/admin/JAF/loading.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
"use client";

import React, { Component } from "react";

class Loading extends Component {
render() {
return (
<div className="h-full w-full text-center flex justify-center items-center font-bold">
Loading...
</div>
);
}
}

export default Loading;
"use client";

import React, { Component } from "react";

class Loading extends Component {
render() {
return (
<div className="h-full w-full text-center flex justify-center items-center font-bold">
Loading...
</div>
);
}
}

export default Loading;
18 changes: 8 additions & 10 deletions src/app/(routes)/admin/JAF/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import React from 'react'
import JAF from '@/components/JAF/JAF'

function page() {
return (
<JAF />
)
}

export default page
import React from "react";
import JAF from "@/components/JAF/JAF";

function page() {
return <JAF />;
}

export default page;
7 changes: 2 additions & 5 deletions src/app/(routes)/admin/companies/@allcompanies/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@ interface Props {}
interface company {
id: string;
name: string;
metadata: object;
createdAt: string;
updatedAt: string;
}

const CompanyPage = async () => {
const Companies = await fetchCompany(cookies()?.get("accessToken")?.value);

if (Companies.companies.length === 0) {
if (Companies?.length === 0) {
return (
<h1 className="text-center text-black text-3xl font-bold flex justify-center items-center w-full h-screen">
No Comapanies Currently Registered
Expand Down Expand Up @@ -53,7 +50,7 @@ const CompanyPage = async () => {

<ScrollArea className="h-72 w-full rounded-md border-t-2">
<div className="p-4">
{Companies?.companies.map((Company: company, index: number) => {
{Companies?.map((Company: company, index: number) => {
return (
<>
<div
Expand Down
85 changes: 2 additions & 83 deletions src/app/(routes)/admin/companies/[companyId]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,84 +1,3 @@
import JAFCard from "@/components/company/JAFCard";
import EachCompanyCard from "@/components/company/EachCompanyCard";
import { AllCompanies } from "@/dummyData/company";
import { fetchEachCompanyDetails } from "@/helpers/api";
import { cookies } from "next/headers";
interface Props {
params: {
companyId: String;
};
}

interface CompanyData {
name: String;
id: String;
jafs: any;
ppoOffers: any;
recruiters: any;
}

export default async function EachCompanyPage({ params }: Props) {
const EachCompany = await fetchEachCompanyDetails(
cookies().get("accessToken")?.value,
params.companyId,
);
return (
<div>
<section className="text-gray-600 body-font">
<div className="container px-5 py-24 mx-auto">
<div className="flex flex-col text-center w-full mb-20">
<h2 className="text-xs text-indigo-500 tracking-widest font-medium title-font mb-1">
12 Dec 2023
</h2>
<h1 className="sm:text-4xl text-3xl font-bold title-font mb-4 text-gray-900">
{EachCompany?.name}
</h1>
</div>

{EachCompany?.jafs?.length === 0 ? (
<h1 className="sm:text-xl font-medium title-font mb-4 text-gray-900 text-center">
No Jobs Listed Currently
</h1>
) : (
<div className="flex flex-wrap">
<JAFCard />
</div>
)}

{EachCompany?.ppoOffers?.length === 0 ? (
<h1 className="sm:text-xl font-medium title-font mb-4 text-gray-900 text-center">
No PPO Offers Currently
</h1>
) : (
<div className="flex flex-wrap">
<JAFCard />
</div>
)}

{EachCompany?.recruiters?.length === 0 ? (
<h1 className="sm:text-xl font-medium title-font mb-4 text-gray-900 text-center">
No Recruiters Currently
</h1>
) : (
<div className="flex flex-wrap">
<JAFCard />
</div>
)}
<section className="text-gray-600 body-font">
<h1 className="text-center mt-10 mb-2">
Sample Cards for Jobs , PPOs and Recruiters in company section
</h1>
<div className="container px-5 mx-auto">
<div className="flex flex-wrap">
<JAFCard />
<JAFCard />
<JAFCard />
<JAFCard />
</div>
</div>
</section>
</div>
</section>
</div>
);
export default function page() {
return <div>page</div>;
}
4 changes: 1 addition & 3 deletions src/app/(routes)/admin/companies/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ const CompanyLayout = ({ children, allcompanies }: Props) => {
return (
<div className="">
{/* {allcompanies} */}
<div className="mx-2 my-4 rounded-md bg-white">
{children}
</div>
<div className="mx-2 my-4 rounded-md bg-white">{children}</div>
</div>
);
};
Expand Down
137 changes: 44 additions & 93 deletions src/app/(routes)/admin/companies/page.tsx
Original file line number Diff line number Diff line change
@@ -1,99 +1,50 @@
import { Button } from "@/components/ui/button"
import { cookies } from "next/headers";
import { Card, CardContent } from "@/components/ui/card"


interface Props { }
import {
fetchAllJobs,
fetchCompany,
fetchCompanyRecruiters,
} from "@/helpers/api";
import AllCompaniesComponent from "@/components/company/AllCompaniesComponent";
import { Suspense } from "react";
import { Separator } from "@/components/ui/separator";
import RecruitersTable from "@/components/RecruitersTable";


interface company {
id: string;
name: string;
metadata: object;
createdAt: string;
updatedAt: string;
}

const CompanyPage = async () => {
const Companies = await fetchCompany(cookies()?.get("accessToken")?.value);
console.log(Companies)
if (Companies.companies.length === 0) {
return (
<h1 className="text-center text-black text-3xl font-bold flex justify-center items-center w-full h-full">
No Comapanies Currently Registered
</h1>
);
}

const Recruiters = await fetchCompanyRecruiters(
cookies()?.get("accessToken")?.value,
cookies()?.get("companyId")?.value,
);

const CompanyRelatedJobs = await fetchAllJobs(
cookies()?.get("accessToken")?.value,
null,
null,
cookies()?.get("companyId")?.value,
null,
null,
);

console.log("CRJ", CompanyRelatedJobs);
"use client";
import { fetchStudentData } from "@/helpers/api";
import Cookies from "js-cookie";
import TableComponent from "@/components/TableComponent/TableComponent";
import generateColumns from "@/components/TableComponent/ColumnMapping";

const jsonData = [
{
id: "string",
userId: "string",
programId: "string",
rollNo: "string",
category: "string",
gender: "MALE",
cpi: 0,
user: {
name: "string",
email: "string",
contact: "string",
},
program: {
course: "string",
branch: "string",
year: "string",
},
},
];

const dynamicColumns = generateColumns(jsonData[0]);

const StudentPage = async () => {
const AllStudents = await fetchStudentData(Cookies.get("accessToken"));
return (
<div className="">
<div className="grid grid-cols-[300px_auto]">
<div>
<AllCompaniesComponent />
</div>
<div>
{cookies()?.get('companyId') != undefined && (
<><div className="flex justify-between items-center">
<div className="text-3xl font-bold mx-5 my-5">{cookies().get('companyName')?.value}</div>
<div className="flex">
<Button variant={"outline"} className="mr-5">See Jobs</Button>
<Button className="mr-5">Update</Button>
<Button className="mr-5" variant="destructive">Delete</Button>
</div>
</div><Separator /><div className="h-[66vh] overflow-y-scroll">
<div className="">
<h1 className="text-xl font-semibold text-start mx-5 my-3">Company Details</h1>
<div className="mx-16">
<ul className="list-disc">
<li>Company Website : <a className="text-blue-600 font-medium">click here</a></li>
<li>Year Of Establishment : 2014</li>
<li>Social Media : <a className="text-blue-600 font-medium">click here</a></li>
<li>Company Size : 1.5 M</li>
<li>Annual Turnover : $278.19 B</li>
</ul>
</div>
</div>
<h1 className="text-xl font-semibold text-start mx-5 my-3">Recruiter Details</h1>
<div className="mx-10">
<RecruitersTable data={Recruiters?.recruiters} />

</div>

</div></>

)}


</div>
<div className="m-10">
<h1 className="text-center font-bold text-3xl my-5 py-5">Students</h1>
<div>
{AllStudents && (
<TableComponent
isAddButton={true}
AddButtonText={"Add Students"}
data={AllStudents}
columns={dynamicColumns}
/>
)}
</div>
</div>
);
};

export default CompanyPage;

// http://tpc.iiti.ac.in/api/v1/companies/3f1d7e53-2069-4820-8d91-64b81f79cf7a/recruiters
export default StudentPage;
Loading

0 comments on commit e53f247

Please sign in to comment.