Fix Bug 67579 - Srv: Spaces. The Backup section displays a back button.

This commit is contained in:
Elyor Djalilov 2024-04-22 16:04:34 +05:00
parent 272f27fef1
commit d3bfdba97e

View File

@ -55,15 +55,18 @@ const SectionHeaderContent = () => {
const location = useLocation();
const navigate = useNavigate();
const path = location.pathname;
const item = getItemByLink(path);
const item = React.useMemo(() => getItemByLink(path), [path]);
const isBackup = path.includes("backup");
const onBackToParent = () => {
navigate(-1);
};
const headerText = isBackup ? t("Backup") : t(item?.tKey);
return (
<StyledHeader>
{!item?.isHeader && (
{item && !item?.isHeader && (
<IconButton
iconName={ArrowPathReactSvgUrl}
size={17}
@ -73,7 +76,7 @@ const SectionHeaderContent = () => {
/>
)}
<Headline type="content" truncate={true}>
<div className="header">{t(item?.tKey)}</div>
<div className="header">{headerText}</div>
</Headline>
</StyledHeader>
);