"use client";
import { apiDefaultParams } from "@/constants/Api_Params";
import { useGetNotificationHistoryQuery } from "@/hooks/queries/useNotificationQueries";
import { usePathname, useRouter } from "next/navigation";
import { useState } from "react";

const useNotificationHistoryTablePresenter = () => {
  const [params, setParams] = useState<Record<string, any>>({
    ...apiDefaultParams,
  });
  const { data, isLoading } = useGetNotificationHistoryQuery(params);

  const columns: string[] = [
    "row",
    "title",
    "channel",
    "created at",
    "message",
    "priority",
    "type",
    "seen",
    "status",
    "actions",
  ];
  const pathName = usePathname();
  const router = useRouter();
  return {
    notificationHistory: data?.data,
    metadata: data?.meta,
    isLoading,
    columns,
    router,
    pathName,
    setParams,
  };
};

export default useNotificationHistoryTablePresenter;
