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

Function NotionRenderer

apps/web/components/NotionRenderer.tsx:12–37  ·  view source on GitHub ↗
({ recordMap }: { recordMap: any })

Source from the content-addressed store, hash-verified

10
11// Week-4-1-647987d9b1894c54ba5c822978377910
12export const NotionRenderer = ({ recordMap }: { recordMap: any }) => {
13 const { resolvedTheme } = useTheme();
14 const isDarkMode = resolvedTheme === "dark";
15
16 const isLegacyMode = useRecoilValue(isLegacyViewMode);
17
18 const components = useMemo(
19 () => ({
20 Code: CodeBlock,
21 // can add more components that are supported here
22 }),
23 []
24 );
25
26 if (!recordMap?.block || Object.keys(recordMap.block).length === 0) {
27 return (
28 <div className="flex flex-col items-center justify-center gap-2 py-24 text-center">
29 <p className="text-lg font-medium">This lesson is temporarily unavailable</p>
30 <p className="text-muted-foreground text-sm">
31 We couldn&apos;t load the content right now. Please refresh in a little while.
32 </p>
33 </div>
34 );
35 }
36
37 return (
38 <NotionRendererLib
39 bodyClassName="text-base sm:text-lg"
40 className={isLegacyMode ? "" : "pt-12 dark:!bg-[#0a0a0a]"}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected