Files
profi-frontend/src/components/LoadingData.tsx

14 lines
443 B
TypeScript
Raw Normal View History

2025-05-31 10:57:27 +03:00
import {ReactElement} from "react";
import {Link} from "react-router-dom";
export function LoadingData({data, children}: {data: object|null|undefined, children: ReactElement}) {
if (data === null){
return <div className={"loading"}>Идёт загрузка...</div>
}
if (data === undefined){
return <Link className={"not-found"} to={"/"}>404 НИЧЕГО НЕ НАЙДЕНО</Link>
}
return children;
}