Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e8d6b98

Browse files
Fix @ts-expect-error unnecessary
1 parent b577986 commit e8d6b98

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

‎packages/gitbook/src/components/DocumentView/InlineIcon.tsx‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { DocumentInlineIcon,DocumentMarkColor } from '@gitbook/api';
1+
import type { DocumentInlineIcon } from '@gitbook/api';
22

33
import { tcls } from '@/lib/tailwind';
44
import { Icon, type IconName } from '@gitbook/icons';
@@ -7,16 +7,11 @@ import { textColorToStyle } from './utils/colors';
77

88
export async function InlineIcon(props: InlineProps<DocumentInlineIcon>) {
99
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;
10+
const { color, icon } = inline.data;
1611

1712
return (
1813
<Icon
19-
icon={icon}
14+
icon={iconasIconName}
2015
className={tcls('inline size-[1em]', color ? textColorToStyle[color] : null)}
2116
/>
2217
);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /