-
-
Notifications
You must be signed in to change notification settings - Fork 20.2k
Expand file tree
/
Copy pathmdx-components.tsx
More file actions
103 lines (102 loc) · 3.67 KB
/
mdx-components.tsx
File metadata and controls
103 lines (102 loc) · 3.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import type { MDXComponents } from "mdx/types";
import type { ComponentPropsWithoutRef } from "react";
import { BeforeAfterEditor, BookPartsNav, BREAKFramework, Callout, ChainErrorDemo, ChainExample, ChainFlowDemo, Checklist, CodeEditor, Collapsible, Compare, ContentPipelineDemo, ContextPlayground, ContextWindowDemo, CostCalculatorDemo, CRISPEFramework, DiffView, EmbeddingsDemo, FallbackDemo, FewShotDemo, FillInTheBlank, IconCheck, IconClipboard, IconLightbulb, IconLock, IconSettings, IconStar, IconTarget, IconUser, IconX, InfoGrid, InteractiveChecklist, IterativeRefinementDemo, JailbreakDemo, JsonYamlDemo, LLMCapabilitiesDemo, NavButton, NavFooter, PrinciplesSummary, PromptAnalyzer, PromptBreakdown, PromptBuilder, PromptChallenge, PromptDebugger, Quiz, RTFFramework, SpecificitySpectrum, StructuredOutputDemo, SummarizationDemo, TemperatureDemo, TextToImageDemo, TextToVideoDemo, TokenizerDemo, TokenPredictionDemo, TryIt, ValidationDemo, VersionDiff } from "@/components/book/interactive";
import { PromiCharacter, PromiWithMessage, Panel, StoryScene, PromptVsMistake, MagicWords, DragDropPrompt, LevelComplete, Section, PromptParts, ExampleMatcher, PromptDoctor, StepByStep, PromptLab, WordPredictor } from "@/components/kids/elements";
export function useMDXComponents(components: MDXComponents): MDXComponents {
return {
...components,
table: ({ ref: _ref, ...props }: ComponentPropsWithoutRef<"table"> & { ref?: unknown }) => (
<div className="my-6 w-full overflow-x-auto">
<table className="w-full border-collapse text-sm" {...props} />
</div>
),
thead: ({ ref: _ref, ...props }: ComponentPropsWithoutRef<"thead"> & { ref?: unknown }) => (
<thead className="bg-muted/50" {...props} />
),
tbody: ({ ref: _ref, ...props }: ComponentPropsWithoutRef<"tbody"> & { ref?: unknown }) => (
<tbody {...props} />
),
th: ({ ref: _ref, ...props }: ComponentPropsWithoutRef<"th"> & { ref?: unknown }) => (
<th className="border border-border px-4 py-2 text-left font-semibold" {...props} />
),
td: ({ ref: _ref, ...props }: ComponentPropsWithoutRef<"td"> & { ref?: unknown }) => (
<td className="border border-border px-4 py-2" {...props} />
),
tr: ({ ref: _ref, ...props }: ComponentPropsWithoutRef<"tr"> & { ref?: unknown }) => (
<tr className="even:bg-muted/30" {...props} />
),
BeforeAfterEditor,
BookPartsNav,
BREAKFramework,
Callout,
ChainErrorDemo,
ChainExample,
ChainFlowDemo,
Checklist,
CodeEditor,
Collapsible,
Compare,
ContentPipelineDemo,
ContextPlayground,
ContextWindowDemo,
CostCalculatorDemo,
CRISPEFramework,
DiffView,
EmbeddingsDemo,
FallbackDemo,
FewShotDemo,
FillInTheBlank,
IconCheck,
IconClipboard,
IconLightbulb,
IconLock,
IconSettings,
IconStar,
IconTarget,
IconUser,
IconX,
InfoGrid,
InteractiveChecklist,
IterativeRefinementDemo,
JailbreakDemo,
JsonYamlDemo,
LLMCapabilitiesDemo,
NavButton,
NavFooter,
PrinciplesSummary,
PromptAnalyzer,
PromptBreakdown,
PromptBuilder,
PromptChallenge,
PromptDebugger,
Quiz,
RTFFramework,
SpecificitySpectrum,
StructuredOutputDemo,
SummarizationDemo,
TemperatureDemo,
TextToImageDemo,
TextToVideoDemo,
TokenizerDemo,
TokenPredictionDemo,
TryIt,
ValidationDemo,
VersionDiff,
// Kids components
PromiCharacter,
PromiWithMessage,
Panel,
StoryScene,
PromptVsMistake,
MagicWords,
DragDropPrompt,
LevelComplete,
Section,
PromptParts,
ExampleMatcher,
PromptDoctor,
StepByStep,
PromptLab,
WordPredictor,
};
}