diff --git a/src/components/Breadcrumbs.tsx b/src/components/Breadcrumbs.tsx index 1eab47c..59bfac9 100644 --- a/src/components/Breadcrumbs.tsx +++ b/src/components/Breadcrumbs.tsx @@ -1,7 +1,7 @@ -import React, { useMemo } from 'react' +import React from 'react' import { Link, useLocation } from 'react-router-dom' import { ChevronRight, Home as HomeIcon } from 'lucide-react' -import { getLocaleFromPathname, stripLocalePrefix, withLocalePath } from '../lib/i18n' +import { getLocaleFromPathname, withLocalePath } from '../lib/i18n' export type BreadcrumbItem = { label: string @@ -15,48 +15,40 @@ type BreadcrumbsProps = { export const Breadcrumbs: React.FC = ({ items, className }) => { const location = useLocation() - const locale = useMemo(() => getLocaleFromPathname(location.pathname), [location.pathname]) - - const homeLabel = locale === 'en' ? 'Home' : '首页' - const homeHref = withLocalePath(locale, '/') - - const normalizedItems = useMemo(() => { - const prefix = stripLocalePrefix(location.pathname).startsWith('/') ? '' : '/' - void prefix - return items - }, [items, location.pathname]) + const locale = getLocaleFromPathname(location.pathname) return (