Files
gitbook/packages/react-contentkit/src/ElementIcon.tsx
2025-02-26 17:59:34 +01:00

13 lines
400 B
TypeScript

import type { ContentKitIcon } from '@gitbook/api';
import type { ContentKitServerContext } from './types';
export function ElementIcon(props: { icon: ContentKitIcon; context: ContentKitServerContext }) {
const { icon, context } = props;
const C = context.icons[icon];
if (!C) {
return <span className="contentkit-icon" />;
}
return <C className="contentkit-icon" />;
}