add llama suggestions
This commit is contained in:
1 parent
85f00eb7e8
commit
80d121e87a
3 files changed
+9
-8
No files matched your search
@@ -17,9 +17,9 @@ const PageStateWrapper = ({
|
|||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const isAdmin = useIsAdmin();
|
const isAdmin = useIsAdmin();
|
||||||
const hasInitialized = !isLoading && items !== undefined;
|
const isEmpty = items === null || (Array.isArray(items) && items.length === 0);
|
||||||
const showEmpty = items == undefined || items.length === 0;
|
const hasInitialized = items !== undefined && !(isLoading && isEmpty);
|
||||||
|
const showEmpty = !isLoading && isEmpty;
|
||||||
if (networkError) {
|
if (networkError) {
|
||||||
return (
|
return (
|
||||||
<GenericFallback>
|
<GenericFallback>
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ const useCreateNotification = () => {
|
|||||||
|
|
||||||
const useGetNotificationsByTeamId = (updateTrigger) => {
|
const useGetNotificationsByTeamId = (updateTrigger) => {
|
||||||
const [notifications, setNotifications] = useState([]);
|
const [notifications, setNotifications] = useState([]);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(true);
|
||||||
const [error, setError] = useState(null);
|
const [error, setError] = useState(null);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
|||||||
@@ -15,13 +15,13 @@ const Maintenance = () => {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const rowsPerPage = useSelector((state) => state?.ui?.maintenance?.rowsPerPage ?? 5);
|
const rowsPerPage = useSelector((state) => state?.ui?.maintenance?.rowsPerPage ?? 5);
|
||||||
const [maintenanceWindows, setMaintenanceWindows] = useState([]);
|
const [maintenanceWindows, setMaintenanceWindows] = useState(undefined);
|
||||||
const [maintenanceWindowCount, setMaintenanceWindowCount] = useState(0);
|
const [maintenanceWindowCount, setMaintenanceWindowCount] = useState(0);
|
||||||
const [page, setPage] = useState(0);
|
const [page, setPage] = useState(0);
|
||||||
const [sort, setSort] = useState({});
|
const [sort, setSort] = useState({});
|
||||||
const [updateTrigger, setUpdateTrigger] = useState(false);
|
const [updateTrigger, setUpdateTrigger] = useState(false);
|
||||||
const [networkError, setNetworkError] = useState(false);
|
const [networkError, setNetworkError] = useState(false);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(true)
|
||||||
|
|
||||||
const handleActionMenuDelete = () => {
|
const handleActionMenuDelete = () => {
|
||||||
setUpdateTrigger((prev) => !prev);
|
setUpdateTrigger((prev) => !prev);
|
||||||
@@ -30,14 +30,15 @@ const Maintenance = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchMaintenanceWindows = async () => {
|
const fetchMaintenanceWindows = async () => {
|
||||||
try {
|
try {
|
||||||
|
setNetworkError(false);
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
const response = await networkService.getMaintenanceWindowsByTeamId({
|
const response = await networkService.getMaintenanceWindowsByTeamId({
|
||||||
page: page,
|
page: page,
|
||||||
rowsPerPage: rowsPerPage,
|
rowsPerPage: rowsPerPage,
|
||||||
});
|
});
|
||||||
const { maintenanceWindows, maintenanceWindowCount } = response.data.data;
|
const { maintenanceWindows, maintenanceWindowCount } = response.data.data;
|
||||||
setMaintenanceWindows(maintenanceWindows);
|
setMaintenanceWindows(maintenanceWindows ?? []);
|
||||||
setMaintenanceWindowCount(maintenanceWindowCount);
|
setMaintenanceWindowCount(maintenanceWindowCount ?? 0);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setNetworkError(true);
|
setNetworkError(true);
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in new issue
Block a user