LFFE-29 structured table of data
This commit is contained in:
@@ -22,11 +22,21 @@ const TableContent = ({rowId}) => {
|
||||
|
||||
return (
|
||||
<Box>
|
||||
{error ? (<Typography>{t("LoanHistory.Table_history_error")}</Typography>) :
|
||||
{error ? (<Typography sx={{
|
||||
padding: 2,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center"
|
||||
}}>{t("LoanHistory.Table_history_error")}</Typography>) :
|
||||
(isLoading ? (<LinearProgress sx={{width: "100%"}}/>) : (
|
||||
history_details.latest_histories.length === 0 ? (
|
||||
<Typography
|
||||
sx={{padding: 2}}
|
||||
sx={{
|
||||
padding: 2,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center"
|
||||
}}
|
||||
variant={'h6'}>{t("LoanHistory.empty_history_detail")}</Typography>
|
||||
) : (
|
||||
<Paper elevation={0} sx={{
|
||||
|
||||
@@ -14,7 +14,7 @@ import ManageAccountsIcon from '@mui/icons-material/ManageAccounts';
|
||||
import PersonIcon from '@mui/icons-material/Person';
|
||||
import AccessibilityIcon from '@mui/icons-material/Accessibility';
|
||||
import AssessmentIcon from '@mui/icons-material/Assessment';
|
||||
import AccessTimeIcon from '@mui/icons-material/AccessTime';
|
||||
import SecurityIcon from '@mui/icons-material/Security';
|
||||
|
||||
const sidebarMenu = [
|
||||
[
|
||||
@@ -182,7 +182,7 @@ const sidebarMenu = [
|
||||
name: "loan-history",
|
||||
type: "page",
|
||||
route: "/dashboard/loan-history",
|
||||
icon: <AccessTimeIcon sx={{width: 'inherit', height: 'inherit'}}/>,
|
||||
icon: <SecurityIcon sx={{width: 'inherit', height: 'inherit'}}/>,
|
||||
selected: false,
|
||||
permission: "manage_navgan_loan",
|
||||
},
|
||||
|
||||
@@ -13,7 +13,11 @@ const useHistory = (url) => {
|
||||
})
|
||||
};
|
||||
|
||||
const {data, isLoading, error} = useSWR(url, fetcher)
|
||||
const {data, isLoading, error} = useSWR(url, fetcher, {
|
||||
revalidateIfStale: false,
|
||||
revalidateOnFocus: false,
|
||||
revalidateOnReconnect: false
|
||||
})
|
||||
const history_details = data
|
||||
//swr config
|
||||
|
||||
|
||||
Reference in New Issue
Block a user