1- import type { ReactElement } from 'react' ;
21import { toJsxRuntime } from 'hast-util-to-jsx-runtime' ;
2+ import type { ReactElement } from 'react' ;
33import { Fragment , jsx , jsxs } from 'react/jsx-runtime' ;
44import { renderMarkdownToHast } from '@/lib/markdown' ;
55
@@ -77,11 +77,7 @@ async function renderCell(
7777
7878 // If there's a note, wrap in a tooltip
7979 if ( noteElement ) {
80- return (
81- < abbr title = { note } >
82- { displayValue }
83- </ abbr >
84- ) ;
80+ return < abbr title = { note } > { displayValue } </ abbr > ;
8581 }
8682
8783 return < span > { displayValue } </ span > ;
@@ -124,9 +120,7 @@ export async function ComparisonTable({
124120
125121 // Filter sections if sectionTitle is provided
126122 const sectionsToRender = sectionTitle
127- ? ( comparison . comparison ?. sections || [ ] ) . filter (
128- ( section ) => section . title === sectionTitle
129- )
123+ ? ( comparison . comparison ?. sections || [ ] ) . filter ( ( section ) => section . title === sectionTitle )
130124 : comparison . comparison ?. sections || [ ] ;
131125
132126 if ( sectionTitle && sectionsToRender . length === 0 ) {
@@ -157,31 +151,29 @@ export async function ComparisonTable({
157151 if ( sectionTitle ) {
158152 const section = processedSections [ 0 ] ;
159153 return (
160- < table className = "w-full border-collapse rounded-md" >
161- < thead >
162- < tr className = "border-b border-fd-border bg-fd-muted/50" >
163- < th className = "p-4 text-left font-semibold" > Feature</ th >
164- < th className = "p-4 text-center font-semibold w-32" > Inkeep</ th >
165- < th className = "p-4 text-center font-semibold w-32" >
166- { comparison . competitor }
167- </ th >
154+ < table className = "w-full border-collapse rounded-md" >
155+ < thead >
156+ < tr className = "border-b border-fd-border bg-fd-muted/50" >
157+ < th className = "p-4 text-left font-semibold" > Feature</ th >
158+ < th className = "p-4 text-center font-semibold w-32" > Inkeep</ th >
159+ < th className = "p-4 text-center font-semibold w-32" > { comparison . competitor } </ th >
160+ </ tr >
161+ </ thead >
162+ < tbody >
163+ { section . processedRows . map ( ( row , idx ) => (
164+ < tr
165+ key = { idx }
166+ className = { `border-b border-fd-border last:border-b-0 hover:bg-fd-muted/30 transition-colors ${
167+ idx % 2 === 0 ? 'bg-white dark:bg-transparent' : 'bg-fd-muted/10'
168+ } `}
169+ >
170+ < td className = "p-4 font-medium" > { row . feature } </ td >
171+ < td className = "p-4 text-center align-top" > { row . inkeepCell } </ td >
172+ < td className = "p-4 text-center align-top" > { row . competitorCell } </ td >
168173 </ tr >
169- </ thead >
170- < tbody >
171- { section . processedRows . map ( ( row , idx ) => (
172- < tr
173- key = { idx }
174- className = { `border-b border-fd-border last:border-b-0 hover:bg-fd-muted/30 transition-colors ${
175- idx % 2 === 0 ? 'bg-white dark:bg-transparent' : 'bg-fd-muted/10'
176- } `}
177- >
178- < td className = "p-4 font-medium" > { row . feature } </ td >
179- < td className = "p-4 text-center align-top" > { row . inkeepCell } </ td >
180- < td className = "p-4 text-center align-top" > { row . competitorCell } </ td >
181- </ tr >
182- ) ) }
183- </ tbody >
184- </ table >
174+ ) ) }
175+ </ tbody >
176+ </ table >
185177 ) ;
186178 }
187179
@@ -197,9 +189,7 @@ export async function ComparisonTable({
197189 < tr className = "border-b border-fd-border bg-fd-muted/50" >
198190 < th className = "p-4 text-left font-semibold" > Feature</ th >
199191 < th className = "p-4 text-center font-semibold w-32" > Inkeep</ th >
200- < th className = "p-4 text-center font-semibold w-32" >
201- { comparison . competitor }
202- </ th >
192+ < th className = "p-4 text-center font-semibold w-32" > { comparison . competitor } </ th >
203193 </ tr >
204194 </ thead >
205195 < tbody >
@@ -222,4 +212,4 @@ export async function ComparisonTable({
222212 ) ) }
223213 </ div >
224214 ) ;
225- }
215+ }
0 commit comments