mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-17 08:05:19 +00:00
26 lines
667 B
TypeScript
26 lines
667 B
TypeScript
import { ContentKitHStack, ContentKitVStack } from '@gitbook/api';
|
|
import React from 'react';
|
|
|
|
import { ContentKitServerElementProps } from './types';
|
|
import classNames from 'classnames';
|
|
|
|
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>
|
|
);
|
|
}
|