import { createApi } from "@reduxjs/toolkit/query/react"; // add /react for auto-generated hooks
import { baseQueryWithReauth } from "./apiSlice";

interface DeactivatedData {
  id: number;
  email: string;
  first_name: string;
  created_at: string;
}

interface ApiResponse {
  data: {
    data: DeactivatedData[];
  };
}

export const deactivatedAccounts = createApi({
  reducerPath: "deactivatedAccounts",
  baseQuery: baseQueryWithReauth,
  tagTypes: ["Deactivated"],
  endpoints: (builder) => ({
    getContact: builder.query<ApiResponse, void>({
      query: () => "/manage-user-deactivate-list",
      providesTags: ["Deactivated"],
    }),
  }),
});

// ✅ Export the auto-generated hook
export const { useGetContactQuery } = deactivatedAccounts;
