Files
gitbook/packages/react-contentkit/src/ElementIcon.tsx
T
2026-08-13 13:18:42 +00:00

14 lines
401 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" />;
}