mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-21 10:03:31 +00:00
14 lines
417 B
TypeScript
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" />;
|
|
}
|