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;
};
