mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-17 08:05:19 +00:00
23 lines
584 B
TypeScript
23 lines
584 B
TypeScript
import type { ContentKitText } from '@gitbook/api';
|
|
import type React from 'react';
|
|
|
|
import classNames from 'classnames';
|
|
import type { ContentKitServerElementProps } from './types';
|
|
|
|
export function ElementText(
|
|
props: React.PropsWithChildren<ContentKitServerElementProps<ContentKitText>>
|
|
) {
|
|
const { element, children } = props;
|
|
|
|
return (
|
|
<span
|
|
className={classNames(
|
|
'contentkit-text',
|
|
element.style ? `contentkit-text-${element.style}` : null
|
|
)}
|
|
>
|
|
{children}
|
|
</span>
|
|
);
|
|
}
|