We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b577986 commit e8d6b98Copy full SHA for e8d6b98
packages/gitbook/src/components/DocumentView/InlineIcon.tsx
@@ -1,4 +1,4 @@
1
-import type { DocumentInlineIcon,DocumentMarkColor } from '@gitbook/api';
+import type { DocumentInlineIcon } from '@gitbook/api';
2
3
import { tcls } from '@/lib/tailwind';
4
import { Icon, type IconName } from '@gitbook/icons';
@@ -7,16 +7,11 @@ import { textColorToStyle } from './utils/colors';
7
8
export async function InlineIcon(props: InlineProps<DocumentInlineIcon>) {
9
const { inline } = props;
10
- const icon = inline.data.icon as IconName;
11
- // @ts-expect-error remove this comment once API is updated
12
- const color = inline.data.color
13
- ? // @ts-expect-error remove "as DocumentMarkColor['data']['text']" once API is updated
14
- (inline.data.color as DocumentMarkColor['data']['text'])
15
- : undefined;
+ const { color, icon } = inline.data;
16
17
return (
18
<Icon
19
- icon={icon}
+ icon={iconasIconName}
20
className={tcls('inline size-[1em]', color ? textColorToStyle[color] : null)}
21
/>
22
);
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments