feat(tenders-table): add submission and tender deadlines to tender list
- Enhanced TendersTable to display submission deadline, tender deadline, and created at date using unixToDate for better clarity. - Updated useTenderListPresenter to include new columns for submission and tender deadlines. - Modified TenderSchema to make created_at optional, aligning with data structure requirements.
This commit is contained in:
@@ -23,7 +23,7 @@ import Pagination from "@/components/ui/pagination";
|
|||||||
import TableSkeleton from "@/components/ui/TableSkeleton";
|
import TableSkeleton from "@/components/ui/TableSkeleton";
|
||||||
import { _TooltipDefaultParams } from "@/constants/tooltip";
|
import { _TooltipDefaultParams } from "@/constants/tooltip";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { getPaginatedRowNumber } from "@/utils/shared";
|
import { getPaginatedRowNumber, unixToDate } from "@/utils/shared";
|
||||||
import TenderListFilters from "./TenderListFilters";
|
import TenderListFilters from "./TenderListFilters";
|
||||||
const TendersTable = () => {
|
const TendersTable = () => {
|
||||||
const {
|
const {
|
||||||
@@ -87,6 +87,21 @@ const TendersTable = () => {
|
|||||||
<TableCell className="text-start" colSpan={100}>
|
<TableCell className="text-start" colSpan={100}>
|
||||||
{item.country_code}
|
{item.country_code}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
<TableCell className="text-start" colSpan={100}>
|
||||||
|
{unixToDate({
|
||||||
|
unix: item.submission_deadline,
|
||||||
|
hasTime: true,
|
||||||
|
})}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell className="text-start" colSpan={100}>
|
||||||
|
{unixToDate({ unix: item.tender_deadline, hasTime: true })}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell className="text-start" colSpan={100}>
|
||||||
|
{unixToDate({
|
||||||
|
unix: item?.created_at ?? 0,
|
||||||
|
hasTime: true,
|
||||||
|
})}
|
||||||
|
</TableCell>
|
||||||
|
|
||||||
<TableCell className={cn(`text capitalize`)} colSpan={100}>
|
<TableCell className={cn(`text capitalize`)} colSpan={100}>
|
||||||
<Status status={item.status}>{item.status}</Status>
|
<Status status={item.status}>{item.status}</Status>
|
||||||
|
|||||||
@@ -57,6 +57,9 @@ const useTenderListPresenter = () => {
|
|||||||
"row",
|
"row",
|
||||||
"title",
|
"title",
|
||||||
"country code",
|
"country code",
|
||||||
|
"submission deadline",
|
||||||
|
"tender deadline",
|
||||||
|
"created at",
|
||||||
"status",
|
"status",
|
||||||
"actions",
|
"actions",
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export const TenderSchema = z.object({
|
|||||||
submission_deadline: z.number(),
|
submission_deadline: z.number(),
|
||||||
submission_url: z.string(),
|
submission_url: z.string(),
|
||||||
tender_deadline: z.number(),
|
tender_deadline: z.number(),
|
||||||
|
created_at: z.number().optional(),
|
||||||
tender_id: z.string(),
|
tender_id: z.string(),
|
||||||
title: z.string(),
|
title: z.string(),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user