Quiz_dashboard/src/Pages/ReSeller/Sales/useTableColumns.tsx
Moaz Dawalibi 81eb55e2e0 reseller : sales page and collection page
admin: collection and some fixes
2024-09-26 09:40:58 +03:00

56 lines
1.2 KiB
TypeScript

import { TableColumnsType } from "antd";
import { Sales } from "../../../types/Item";
import { useTranslation } from "react-i18next";
export const useColumns = () => {
const [t] = useTranslation();
const columns: TableColumnsType<Sales> = [
{
title: t("columns.id"),
dataIndex: "id",
key: "id",
align: "center",
},
{
title: t("columns.student_full_name"),
key: "student_full_name",
align: "center",
render: (row) => {
return row?.student?.first_name +" "+ row?.student?.last_name;
},
},
{
title: t("columns.grade"),
render: (row) => {
return row?.package?.name;
},
key: "package",
align: "center",
},
{
title: t("columns.paid_price"),
render: (row) => {
return row?.package?.price;
},
key: "price",
align: "center",
},
{
title: t("columns.activation_date"),
dataIndex: "activation_date",
key: "activation_date",
align: "center",
},
{
title: t("columns.expiration_date"),
dataIndex: "expiration_date",
key: "expiration_date",
align: "center",
},
];
return columns;
};