30 lines
836 B
TypeScript
30 lines
836 B
TypeScript
import { useLocation } from "react-router-dom";
|
|
import { ButtonLink, Mono, Page } from "../../../shared/ui";
|
|
|
|
type NotFoundPageProps = {
|
|
/** Where the recovery link leads, for example the current cabinet. */
|
|
homePath?: string;
|
|
homeLabel?: string;
|
|
};
|
|
|
|
export function NotFoundPage({ homePath = "/", homeLabel = "На главную" }: NotFoundPageProps) {
|
|
const { pathname } = useLocation();
|
|
|
|
return (
|
|
<Page
|
|
title="Страница не найдена"
|
|
eyebrow="Ошибка 404"
|
|
lead={
|
|
<>
|
|
Адрес <Mono>{pathname}</Mono> не ведет ни на один экран. Проверьте ссылку или вернитесь к
|
|
началу.
|
|
</>
|
|
}
|
|
>
|
|
<div>
|
|
<ButtonLink to={homePath}>{homeLabel}</ButtonLink>
|
|
</div>
|
|
</Page>
|
|
);
|
|
}
|