@@ -66,64 +66,154 @@ const useCopyToClipboard = ({
6666
6767const defaultComponents = memoizeMarkdownComponents ( {
6868 h1 : ( { className, ...props } ) => (
69- < h1 className = { cn ( "mb-8 scroll-m-20 text-4xl font-extrabold tracking-tight last:mb-0" , className ) } { ...props } />
69+ < h1
70+ className = { cn (
71+ "mb-8 scroll-m-20 text-4xl font-extrabold tracking-tight last:mb-0" ,
72+ className ,
73+ ) }
74+ { ...props }
75+ />
7076 ) ,
7177 h2 : ( { className, ...props } ) => (
72- < h2 className = { cn ( "mb-4 mt-8 scroll-m-20 text-3xl font-semibold tracking-tight first:mt-0 last:mb-0" , className ) } { ...props } />
78+ < h2
79+ className = { cn (
80+ "mb-4 mt-8 scroll-m-20 text-3xl font-semibold tracking-tight first:mt-0 last:mb-0" ,
81+ className ,
82+ ) }
83+ { ...props }
84+ />
7385 ) ,
7486 h3 : ( { className, ...props } ) => (
75- < h3 className = { cn ( "mb-4 mt-6 scroll-m-20 text-2xl font-semibold tracking-tight first:mt-0 last:mb-0" , className ) } { ...props } />
87+ < h3
88+ className = { cn (
89+ "mb-4 mt-6 scroll-m-20 text-2xl font-semibold tracking-tight first:mt-0 last:mb-0" ,
90+ className ,
91+ ) }
92+ { ...props }
93+ />
7694 ) ,
7795 h4 : ( { className, ...props } ) => (
78- < h4 className = { cn ( "mb-4 mt-6 scroll-m-20 text-xl font-semibold tracking-tight first:mt-0 last:mb-0" , className ) } { ...props } />
96+ < h4
97+ className = { cn (
98+ "mb-4 mt-6 scroll-m-20 text-xl font-semibold tracking-tight first:mt-0 last:mb-0" ,
99+ className ,
100+ ) }
101+ { ...props }
102+ />
79103 ) ,
80104 h5 : ( { className, ...props } ) => (
81- < h5 className = { cn ( "my-4 text-lg font-semibold first:mt-0 last:mb-0" , className ) } { ...props } />
105+ < h5
106+ className = { cn (
107+ "my-4 text-lg font-semibold first:mt-0 last:mb-0" ,
108+ className ,
109+ ) }
110+ { ...props }
111+ />
82112 ) ,
83113 h6 : ( { className, ...props } ) => (
84- < h6 className = { cn ( "my-4 font-semibold first:mt-0 last:mb-0" , className ) } { ...props } />
114+ < h6
115+ className = { cn ( "my-4 font-semibold first:mt-0 last:mb-0" , className ) }
116+ { ...props }
117+ />
85118 ) ,
86119 p : ( { className, ...props } ) => (
87- < p className = { cn ( "mb-5 mt-5 text-sm leading-7 first:mt-0 last:mb-0" , className ) } { ...props } />
120+ < p
121+ className = { cn (
122+ "mb-5 mt-5 text-sm leading-7 first:mt-0 last:mb-0" ,
123+ className ,
124+ ) }
125+ { ...props }
126+ />
88127 ) ,
89128 a : ( { className, ...props } ) => (
90- < a className = { cn ( "text-primary font-medium underline underline-offset-4" , className ) } { ...props } />
129+ < a
130+ className = { cn (
131+ "text-primary font-medium underline underline-offset-4" ,
132+ className ,
133+ ) }
134+ { ...props }
135+ />
91136 ) ,
92137 blockquote : ( { className, ...props } ) => (
93- < blockquote className = { cn ( "border-l-2 pl-6 italic" , className ) } { ...props } />
138+ < blockquote
139+ className = { cn ( "border-l-2 pl-6 italic" , className ) }
140+ { ...props }
141+ />
94142 ) ,
95143 ul : ( { className, ...props } ) => (
96- < ul className = { cn ( "my-5 ml-6 list-disc [&>li]:mt-2" , className ) } { ...props } />
144+ < ul
145+ className = { cn ( "my-5 ml-6 list-disc [&>li]:mt-2" , className ) }
146+ { ...props }
147+ />
97148 ) ,
98149 ol : ( { className, ...props } ) => (
99- < ol className = { cn ( "my-5 ml-6 list-decimal [&>li]:mt-2" , className ) } { ...props } />
150+ < ol
151+ className = { cn ( "my-5 ml-6 list-decimal [&>li]:mt-2" , className ) }
152+ { ...props }
153+ />
100154 ) ,
101155 hr : ( { className, ...props } ) => (
102156 < hr className = { cn ( "my-5 border-b" , className ) } { ...props } />
103157 ) ,
104158 table : ( { className, ...props } ) => (
105- < table className = { cn ( "my-5 w-full border-separate border-spacing-0 overflow-y-auto" , className ) } { ...props } />
159+ < table
160+ className = { cn (
161+ "my-5 w-full border-separate border-spacing-0 overflow-y-auto" ,
162+ className ,
163+ ) }
164+ { ...props }
165+ />
106166 ) ,
107167 th : ( { className, ...props } ) => (
108- < th className = { cn ( "bg-muted px-4 py-2 text-left font-bold first:rounded-tl-lg last:rounded-tr-lg [&[align=center]]:text-center [&[align=right]]:text-right" , className ) } { ...props } />
168+ < th
169+ className = { cn (
170+ "bg-muted px-4 py-2 text-left font-bold first:rounded-tl-lg last:rounded-tr-lg [&[align=center]]:text-center [&[align=right]]:text-right" ,
171+ className ,
172+ ) }
173+ { ...props }
174+ />
109175 ) ,
110176 td : ( { className, ...props } ) => (
111- < td className = { cn ( "border-b border-l px-4 py-2 text-left last:border-r [&[align=center]]:text-center [&[align=right]]:text-right" , className ) } { ...props } />
177+ < td
178+ className = { cn (
179+ "border-b border-l px-4 py-2 text-left last:border-r [&[align=center]]:text-center [&[align=right]]:text-right" ,
180+ className ,
181+ ) }
182+ { ...props }
183+ />
112184 ) ,
113185 tr : ( { className, ...props } ) => (
114- < tr className = { cn ( "m-0 border-b p-0 first:border-t [&:last-child>td:first-child]:rounded-bl-lg [&:last-child>td:last-child]:rounded-br-lg" , className ) } { ...props } />
186+ < tr
187+ className = { cn (
188+ "m-0 border-b p-0 first:border-t [&:last-child>td:first-child]:rounded-bl-lg [&:last-child>td:last-child]:rounded-br-lg" ,
189+ className ,
190+ ) }
191+ { ...props }
192+ />
115193 ) ,
116194 sup : ( { className, ...props } ) => (
117- < sup className = { cn ( "[&>a]:text-xs [&>a]:no-underline" , className ) } { ...props } />
195+ < sup
196+ className = { cn ( "[&>a]:text-xs [&>a]:no-underline" , className ) }
197+ { ...props }
198+ />
118199 ) ,
119200 pre : ( { className, ...props } ) => (
120- < pre className = { cn ( "overflow-x-auto rounded-b-lg bg-black p-4 text-white" , className ) } { ...props } />
201+ < pre
202+ className = { cn (
203+ "overflow-x-auto rounded-b-lg bg-black p-4 text-white" ,
204+ className ,
205+ ) }
206+ { ...props }
207+ />
121208 ) ,
122209 code : function Code ( { className, ...props } ) {
123210 const isCodeBlock = useIsMarkdownCodeBlock ( ) ;
124211 return (
125212 < code
126- className = { cn ( ! isCodeBlock && "bg-muted rounded border font-semibold" , className ) }
213+ className = { cn (
214+ ! isCodeBlock && "bg-muted rounded border font-semibold" ,
215+ className ,
216+ ) }
127217 { ...props }
128218 />
129219 ) ;
0 commit comments