import { Page } from "@/pages/base";
import { Box, Button, CircularProgress, Container, Divider, Typography } from "@material-ui/core";
import { Link as RouterLink, useLocation } from "react-router-dom";
import React, { useMemo } from "react";
import { route } from "@/routing";
import { useAsync } from "@/hooks";
import api from "@/api";
export const FallbackPage = () => {
const location = useLocation();
const promise = useMemo(() => api.page.get(location.pathname), [ location.pathname ]);
const { isLoading, value, error } = useAsync(promise);
console.log({ isLoading, value, error, location });
if (isLoading) {
return
}
if (error) {
return
404
Strona nie została znaleziona
}
if (value) {
return
{ value.title.pl }
}
return ;
}
export default FallbackPage;