1
1
import { tcls } from '@/lib/tailwind' ;
2
- import type { VerticalAlignment , DocumentBlockColumns , Length } from '@gitbook/api' ;
2
+ import type { DocumentBlockColumns , Length , VerticalAlignment } from '@gitbook/api' ;
3
3
import type { BlockProps } from '../Block' ;
4
4
import { Blocks } from '../Blocks' ;
5
5
@@ -10,7 +10,11 @@ export function Columns(props: BlockProps<DocumentBlockColumns>) {
10
10
{ block . nodes . map ( ( columnBlock ) => {
11
11
console . log ( 'Rendering column with width:' , columnBlock ) ;
12
12
return (
13
- < Column key = { columnBlock . key } width = { columnBlock . data . width } verticalAlignment = { columnBlock . data . verticalAlignment } >
13
+ < Column
14
+ key = { columnBlock . key }
15
+ width = { columnBlock . data . width }
16
+ verticalAlignment = { columnBlock . data . verticalAlignment }
17
+ >
14
18
< Blocks
15
19
key = { columnBlock . key }
16
20
nodes = { columnBlock . nodes }
@@ -34,10 +38,17 @@ export function Column(props: {
34
38
const { width, verticalAlignment } = props ;
35
39
const { className, style } = transformLengthToCSS ( width ) ;
36
40
return (
37
- < div className = { tcls ( 'flex flex-col' ,
38
- ( verticalAlignment === VerticalAlignment . Top || ! verticalAlignment ) && 'justify-start' ,
39
- verticalAlignment === VerticalAlignment . Middle && 'justify-center' ,
40
- verticalAlignment === VerticalAlignment . Bottom && 'justify-end' , className ) } style = { style } >
41
+ < div
42
+ className = { tcls (
43
+ 'flex flex-col' ,
44
+ ( verticalAlignment === VerticalAlignment . Top || ! verticalAlignment ) &&
45
+ 'justify-start' ,
46
+ verticalAlignment === VerticalAlignment . Middle && 'justify-center' ,
47
+ verticalAlignment === VerticalAlignment . Bottom && 'justify-end' ,
48
+ className
49
+ ) }
50
+ style = { style }
51
+ >
41
52
{ props . children }
42
53
</ div >
43
54
) ;
0 commit comments