11import { ErrorOutlineOutlined , OpenInNewOutlined } from "@mui/icons-material" ;
2- import { Box , Icon , Stack , Typography } from "@mui/material" ;
2+ import { Box , Stack , Typography } from "@mui/material" ;
33import LinkComponent from "components/Link" ;
4- import { PathConfig } from "shared/interface" ;
4+ import { Locale , PathConfig } from "shared/interface" ;
55import { generateUrl } from "shared/utils" ;
6-
6+ import { useTranslation } from "react-i18next" ;
77interface ArchiveBannerProps {
88 name ?: string ;
99 pathConfig ?: PathConfig ;
1010}
1111
1212export function ArchiveBanner ( { name, pathConfig } : ArchiveBannerProps ) {
13- let targetUrl = `https://docs.pingcap.com` ;
13+ const { t } = useTranslation ( ) ;
14+ let targetUrl = "" ;
1415 if ( name && pathConfig ) {
1516 const stableCfg = { ...pathConfig , version : "stable" } ;
1617 const path = generateUrl ( name , stableCfg ) ;
1718 targetUrl = `https://docs.pingcap.com${ path } ` ;
19+ } else {
20+ const lang =
21+ pathConfig ?. locale === Locale . en ? "" : `/${ pathConfig ?. locale } ` ;
22+ targetUrl = `https://docs.pingcap.com${ lang } /tidb/stable` ;
1823 }
1924
2025 return (
@@ -48,8 +53,7 @@ export function ArchiveBanner({ name, pathConfig }: ArchiveBannerProps) {
4853 < ErrorOutlineOutlined sx = { { fontSize : "1rem" , color : "#F2AA18" } } />
4954
5055 < Typography component = "span" variant = "body2" color = "inherit" >
51- You are viewing the archived documentation of TiDB, which no longer
52- receives updates.
56+ { t ( "banner.archive.title" ) }
5357 </ Typography >
5458
5559 < LinkComponent
@@ -62,7 +66,7 @@ export function ArchiveBanner({ name, pathConfig }: ArchiveBannerProps) {
6266 >
6367 < Stack direction = "row" alignItems = "center" spacing = "4px" >
6468 < Typography variant = "body2" color = "secondary" >
65- View latest LTS version docs
69+ { t ( "banner.archive.viewLatestLTSVersion" ) }
6670 </ Typography >
6771 < OpenInNewOutlined
6872 sx = { {
0 commit comments