import { useLocation } from "react-router-dom";
import React from "react";
import DataTable from "../../Layout/Dashboard/Table/DataTable";
import { useColumns } from "./useTableColumns";
import useSearchQuery from "../../api/utils/useSearchQuery";
import { useGetAllAdmin } from "../../api/admin";

const App: React.FC = () => {
  const [searchQuery] = useSearchQuery("name");

  const response = useGetAllAdmin({
    username: searchQuery,
    pagination: true,
  });

  return <DataTable response={response} useColumns={useColumns} />;
};

export default App;
