MCPcopy Create free account
hub / github.com/code100x/daily-code / TrackComponent

Function TrackComponent

apps/web/app/tracks/[...trackIds]/page.tsx:70–103  ·  view source on GitHub ↗
({ params }: { params: { trackIds: string[] } })

Source from the content-addressed store, hash-verified

68
69export default async function TrackComponent({ params }: { params: { trackIds: string[] } }) {
70 const trackId: string = params.trackIds[0] || "";
71 const problemId = params.trackIds[1];
72 let notionRecordMap = null;
73 if (trackId === "43XrfL4n0LgSnTkSB4rO") {
74 redirect("/tracks/oAjvkeRNZThPMxZf4aX5");
75 }
76
77 const [problemDetails, trackDetails] = await Promise.all([getProblem(problemId || null), getTrack(trackId)]);
78
79 if (trackDetails && !problemId) {
80 return <RedirectToLastSolved trackId={trackId} />;
81 }
82
83 if (problemDetails?.notionDocId) {
84 notionRecordMap = await fetchNotionPage(notion, problemDetails.notionDocId);
85 }
86
87 if (trackDetails && problemDetails) {
88 return (
89 <LessonView
90 showAppBar
91 showPagination
92 track={trackDetails}
93 problem={{
94 ...problemDetails,
95 notionRecordMap,
96 }}
97 />
98 );
99 } else {
100 notFound();
101 }
102}

Callers

nothing calls this directly

Calls 3

getProblemFunction · 0.90
getTrackFunction · 0.90
fetchNotionPageFunction · 0.90

Tested by

no test coverage detected