Files
gitbook/packages/react-contentkit/src/ElementStack.tsx
T
Samy Pessé 70c6c9df42 First pass at implementing ContentKit (#69)
* Start

* Try webframe

* Lint and format

* Move to package

* Continue

* Implement card and cleanup contexts

* Start code blocks

* Start rendering image

* Continue with card

* Start stack

* Start text

* Start modal

* Format

* Continue

* Fix TS errors

* Cleanup

* Make markdown work with server components

* Format

* Add visual test

* Lint and format

* Fix lifecycle

* Implement textinput

* Divider

* Remove console logs

* Remove listSpaceIntegrationsBlocks
2024-02-28 14:46:47 +01:00

25 lines
640 B
TypeScript

import { ContentKitHStack, ContentKitVStack } from '@gitbook/api';
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>
);
}