@@ -131,7 +131,7 @@ export const StyledMarkdownBlock = ({ markdown }: StyledMarkdownBlockProps) => {
131
131
{ children }
132
132
</ table >
133
133
</ div >
134
-
134
+
135
135
{ /* Mobile Table */ }
136
136
< div className = 'lg:hidden' >
137
137
< div className = 'bg-white dark:bg-slate-800 border border-gray-200' >
@@ -152,9 +152,7 @@ export const StyledMarkdownBlock = ({ markdown }: StyledMarkdownBlockProps) => {
152
152
{ children }
153
153
</ thead >
154
154
{ /* Mobile Header - hidden on mobile as we'll show data in cards */ }
155
- < thead className = 'lg:hidden hidden' >
156
- { children }
157
- </ thead >
155
+ < thead className = 'lg:hidden hidden' > { children } </ thead >
158
156
</ >
159
157
) ;
160
158
} ,
@@ -179,7 +177,9 @@ export const StyledMarkdownBlock = ({ markdown }: StyledMarkdownBlockProps) => {
179
177
const headerTexts : string [ ] = [ ] ;
180
178
React . Children . forEach ( children , ( child ) => {
181
179
if ( React . isValidElement ( child ) && child . type === 'th' ) {
182
- const childProps = child . props as { children ?: React . ReactNode } ;
180
+ const childProps = child . props as {
181
+ children ?: React . ReactNode ;
182
+ } ;
183
183
if ( childProps . children ) {
184
184
headerTexts . push ( String ( childProps . children ) ) ;
185
185
}
@@ -192,16 +192,22 @@ export const StyledMarkdownBlock = ({ markdown }: StyledMarkdownBlockProps) => {
192
192
< tr className = 'hidden lg:table-row even:bg-blue-50 dark:even:bg-slate-900 even:bg-opacity-40' >
193
193
{ children }
194
194
</ tr >
195
-
195
+
196
196
{ /* Mobile Row - Card Layout */ }
197
197
< tr className = 'lg:hidden table-row' >
198
198
< td className = 'p-4 border-b border-gray-200' >
199
199
< div className = 'space-y-2' >
200
200
{ React . Children . map ( children , ( child , index ) => {
201
- if ( React . isValidElement ( child ) && child . type === 'td' ) {
202
- const childProps = child . props as { children ?: React . ReactNode } ;
201
+ if (
202
+ React . isValidElement ( child ) &&
203
+ child . type === 'td'
204
+ ) {
205
+ const childProps = child . props as {
206
+ children ?: React . ReactNode ;
207
+ } ;
203
208
if ( childProps . children ) {
204
- const headerText = headerTexts [ index ] || `Column ${ index + 1 } ` ;
209
+ const headerText =
210
+ headerTexts [ index ] || `Column ${ index + 1 } ` ;
205
211
return (
206
212
< div key = { index } className = 'flex flex-col' >
207
213
< div className = 'text-sm font-medium text-gray-600 dark:text-gray-300 mb-1' >
0 commit comments