MCPcopy Create free account
hub / github.com/editablejs/editable / Breadcrumbs

Function Breadcrumbs

apps/docs/src/components/breadcrumbs.tsx:6–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4import { useTranslation } from 'react-i18next'
5
6function Breadcrumbs() {
7 const { breadcrumbs } = useRouteMeta()
8 const { t } = useTranslation()
9 if (!breadcrumbs) return null
10 return (
11 <div tw="flex">
12 {breadcrumbs.map(
13 (crumb, i) =>
14 crumb.path && (
15 <div tw="mb-3 mt-0.5 flex items-center" key={i}>
16 <React.Fragment key={crumb.path}>
17 <Link href={crumb.path}>
18 <a tw="text-link dark:text-link-dark mr-1 text-sm font-bold uppercase tracking-wide hover:underline">
19 {t(crumb.title)}
20 </a>
21 </Link>
22 <span tw="text-link dark:text-link-dark mr-1 inline-block text-lg">
23 <svg
24 width="20"
25 height="20"
26 viewBox="0 0 20 20"
27 fill="none"
28 xmlns="http://www.w3.org/2000/svg"
29 >
30 <path
31 d="M6.86612 13.6161C6.37796 14.1043 6.37796 14.8957 6.86612 15.3839C7.35427 15.872 8.14572 15.872 8.63388 15.3839L13.1339 10.8839C13.622 10.3957 13.622 9.60428 13.1339 9.11612L8.63388 4.61612C8.14572 4.12797 7.35427 4.12797 6.86612 4.61612C6.37796 5.10428 6.37796 5.89573 6.86612 6.38388L10.4822 10L6.86612 13.6161Z"
32 fill="currentColor"
33 />
34 </svg>
35 </span>
36 </React.Fragment>
37 </div>
38 ),
39 )}
40 </div>
41 )
42}
43
44export default Breadcrumbs

Callers

nothing calls this directly

Calls 1

useRouteMetaFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…