
import React, { useMemo } from "react";
import { useTranslation } from "react-i18next";
import Actions from "../../Components/Ui/tables/Actions";
import ColumnsImage from "../../Components/Columns/ColumnsImage";
import { useNavigate } from "react-router-dom";
import { useDeleteNotification } from "../../api/notification";
import { Switch } from "antd";
import { MdEmail } from "react-icons/md";
import { useModalState } from "../../zustand/Modal";


const useTableColumns: any = () => {
  const [t] = useTranslation();
  const deleteMutation = useDeleteNotification()
  const navigate = useNavigate()

  const { setIsOpen } = useModalState(state => state)

  const language = localStorage.getItem("language") ?? "en"

  return useMemo(
    () => [

      {
        name: t("id"),
        sortable: true, // Enable sorting for id column
        center: true,
        selector: (row: any) => row.id, // Specify selector function for sorting
      },      {
        name: t("name"),
        sortable: false,
        center: "true",
        cell: (row: any) => row?.user?.name
      },
      {
        name: t("title"),
        sortable: false,
        center: "true",
        cell: (row: any) => row?.title[language]
      },
      {
        name: t("body"),
        sortable: false,
        center: "true",
        cell: (row: any) => row?.body[language]
      },

      // {
      //   name: "#",
      //   sortable: false,
      //   center: true,
      //   cell: (row: any) => (
      //     <Actions
      //       objectToEdit={row}
      //       showEdit={false}
      //       onEdit={() => navigate(`/notification/${row.id}`)}
      //       showView={false}
      //       onDelete={() => deleteMutation.mutate({ id: row.id })}
      //     >

      //     </Actions>
      //   ),
      // },

    ],
    [t]
  );
};

export default useTableColumns;

