mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-16 23:55:20 +00:00
26 lines
680 B
TypeScript
26 lines
680 B
TypeScript
import type { ContentKitHStack, ContentKitVStack } from '@gitbook/api';
|
|
import type React from 'react';
|
|
|
|
import classNames from 'classnames';
|
|
import type { ContentKitServerElementProps } from './types';
|
|
|
|
export function ElementStack(
|
|
props: React.PropsWithChildren<
|
|
ContentKitServerElementProps<ContentKitHStack | ContentKitVStack>
|
|
>
|
|
) {
|
|
const { element, children } = props;
|
|
|
|
return (
|
|
<div
|
|
className={classNames(
|
|
'contentkit-stack',
|
|
`contentkit-${element.type}`,
|
|
`contentkit-stack-align-${element.align ?? 'start'}`
|
|
)}
|
|
>
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|