Files
gitbook/packages/gitbook/src/components/DocumentView/InlineIcon.tsx
T
2025-10-24 16:27:23 +02:00

19 lines
567 B
TypeScript

import type { DocumentInlineIcon } from '@gitbook/api';
import { tcls } from '@/lib/tailwind';
import { Icon, type IconName } from '@gitbook/icons';
import type { InlineProps } from './Inline';
import { textColorToStyle } from './utils/colors';
export async function InlineIcon(props: InlineProps<DocumentInlineIcon>) {
const { inline } = props;
const { color, icon } = inline.data;
return (
<Icon
icon={icon as IconName}
className={tcls('inline size-[1em]', color ? textColorToStyle[color] : null)}
/>
);
}