MCPcopy Create free account
hub / github.com/code100x/cms / findChildContent

Function findChildContent

src/components/BreadCrumbComponent.tsx:29–41  ·  view source on GitHub ↗
(contents: any, childId: any)

Source from the content-addressed store, hash-verified

27 courseContent: any;
28}) {
29 const findChildContent = (contents: any, childId: any) => {
30 for (const content of contents) {
31 if (content.id === childId) {
32 return content;
33 } else if (content.children && content.children.length > 0) {
34 const childContent: any = findChildContent(content.children, childId);
35 if (childContent) {
36 return childContent;
37 }
38 }
39 }
40 return undefined;
41 };
42
43 const generateBreadcrumbs = useMemo(() => {
44 const breadcrumbs = [];

Callers 1

BreadCrumbComponentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected