src/components/application/ApplicationRow.tsx
/* eslint-disable */
import React from "react";
import { getStatusClass } from "./ApplicationStatus";
import ApplicationActions from "./ApplicationActions";
interface Application {
_id:string,
userId?: {
_id:string,
firstname: string,
lastname: string,
email: string,
gender: string,
},
jobId?:{
_id:string,
title:string
},
status:string,
createdAt: string
}
interface ApplicationRowProps {
application: Application;
isDrop: string | number;
setDrop: (id: string | number) => void;
}
const ApplicationRow: React.FC<ApplicationRowProps> = ({ application, isDrop, setDrop }) => (
<tr className="hover:bg-gray-50 dark:hover:bg-gray-700/50">
<td className="px-5 py-3 border-b-2 border-gray-200 dark:border-dark-tertiary text-left text-[0.8rem] font-semibold text-gray-600 dark:text-white uppercase tracking-wider">
{application.userId?.firstname}
</td>
<td className="px-5 py-3 border-b-2 border-gray-200 dark:border-dark-tertiary text-left text-[0.85rem] font-semibold text-gray-600 dark:text-white tracking-wider">
{application.userId?.lastname}
</td>
<td className="px-5 py-3 border-b-2 border-gray-200 dark:border-dark-tertiary text-left text-[0.85rem] font-semibold text-gray-600 dark:text-white tracking-wider">
{application.jobId?.title}
</td>
<td className="px-5 py-5 border-b border-gray-200 dark:border-dark-tertiary">
<span className={`inline-block py-1 px-3 whitespace-nowrap rounded-full text-sm ${getStatusClass(application.status)}`}>
{application.status}
</span>
</td>
<td className="px-5 py-3 border-b-2 border-gray-200 dark:border-dark-tertiary text-left text-[0.85rem] font-semibold text-gray-600 dark:text-white tracking-wider">
{application.createdAt}
</td>
<td className="px-5 py-5 border-b border-gray-200 dark:border-dark-tertiary text-sm">
<ApplicationActions _id={application._id} isDrop={isDrop} setDrop={setDrop} />
</td>
</tr>
);
export default ApplicationRow;