// material-ui
import {
Box,
Grid, Typography
} from '@mui/material';
import MainCard from "../../components/MainCard";
import {useEffect, useState} from "react";
import * as React from "react";
import axios from "axios";
import {apiPath} from "../../auth/utils";
import {GET_APPRECIATION_CATEGORY_LIST} from "../../utils/ApiPathConst";
import LoadingComponent from "../extra-pages/LoadingComponent";
import {LIONER_FORM_THEME, CARD_MAX_WIDTH} from "../../themes/themeConst";
import {ThemeProvider} from "@emotion/react";
import AppreciationCategorySearchForm from "./AppreciationCategorySearchForm";
import AppreciationCategoryTable from "./AppreciationCategoryTable";
// ==============================|| DASHBOARD - DEFAULT ||============================== //
const AppreciationCategoryIndex = () => {
const [record, setRecord] = useState([]);
const [searchCriteria, setSearchCriteria] = useState({});
const [onReady, setOnReady] = useState(false);
useEffect(() => {
getGroupList();
}, []);
useEffect(() => {
setOnReady(true);
}, [record]);
useEffect(() => {
getGroupList();
}, [searchCriteria]);
function getGroupList() {
axios.get(`${apiPath}${GET_APPRECIATION_CATEGORY_LIST}`,
{params: searchCriteria}
)
.then((response) => {
if (response.status === 200) {
if(response.data.records !== record){
setRecord(response.data.records);
}
}
})
.catch(error => {
console.log(error);
return false;
});
}
function applySearch(input) {
setSearchCriteria(input);
}
return (
!onReady ?
:
View Appreciation Category
{/*row 1*/}
{/*row 2*/}
);
};
export default AppreciationCategoryIndex;