Files
profi-frontend/src/components/LoadingData.tsx
2025-05-31 10:57:27 +03:00

14 lines
443 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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;
}