Files
gitbook/packages/react-contentkit/src/ElementIcon.tsx
T

14 lines
417 B
TypeScript

import { ContentKitIcon } from '@gitbook/api';
import React from 'react';
import { 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" />;
}