Skip to content

Commit a1e1ad0

Browse files
committed
format fixes
1 parent 828b1db commit a1e1ad0

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

components/StyledMarkdownBlock.tsx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export const StyledMarkdownBlock = ({ markdown }: StyledMarkdownBlockProps) => {
131131
{children}
132132
</table>
133133
</div>
134-
134+
135135
{/* Mobile Table */}
136136
<div className='lg:hidden'>
137137
<div className='bg-white dark:bg-slate-800 border border-gray-200'>
@@ -152,9 +152,7 @@ export const StyledMarkdownBlock = ({ markdown }: StyledMarkdownBlockProps) => {
152152
{children}
153153
</thead>
154154
{/* 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>
158156
</>
159157
);
160158
},
@@ -179,7 +177,9 @@ export const StyledMarkdownBlock = ({ markdown }: StyledMarkdownBlockProps) => {
179177
const headerTexts: string[] = [];
180178
React.Children.forEach(children, (child) => {
181179
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+
};
183183
if (childProps.children) {
184184
headerTexts.push(String(childProps.children));
185185
}
@@ -192,16 +192,22 @@ export const StyledMarkdownBlock = ({ markdown }: StyledMarkdownBlockProps) => {
192192
<tr className='hidden lg:table-row even:bg-blue-50 dark:even:bg-slate-900 even:bg-opacity-40'>
193193
{children}
194194
</tr>
195-
195+
196196
{/* Mobile Row - Card Layout */}
197197
<tr className='lg:hidden table-row'>
198198
<td className='p-4 border-b border-gray-200'>
199199
<div className='space-y-2'>
200200
{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+
};
203208
if (childProps.children) {
204-
const headerText = headerTexts[index] || `Column ${index + 1}`;
209+
const headerText =
210+
headerTexts[index] || `Column ${index + 1}`;
205211
return (
206212
<div key={index} className='flex flex-col'>
207213
<div className='text-sm font-medium text-gray-600 dark:text-gray-300 mb-1'>

0 commit comments

Comments
 (0)