Skip to content

Commit 01da321

Browse files
author
Jacob Logan
committed
update link to display literal type
1 parent 8cbc2f7 commit 01da321

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/components/ApiDocs/ApiComment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface ApiCommentProps {
1010
export const ApiComment = ({ apiComment, codeBlock }: ApiCommentProps) => {
1111
if (!apiComment) return null;
1212
const firstItem = apiComment[0];
13-
if (!firstItem.text.replaceAll('-', '').trim()) {
13+
if (!firstItem?.text?.replaceAll('-', '')?.trim()) {
1414
apiComment.shift();
1515
}
1616
const commentList = apiComment.map((snippet, idx) => {

src/components/ApiDocs/display/TypeLink.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export interface LinkDataType {
77
kind: number;
88
type: string | LinkDataType;
99
target: number;
10+
value: string;
1011
}
1112

1213
export interface TypeLinkInterface {
@@ -34,6 +35,8 @@ export const TypeLink = ({ linkData, breadCrumbs }: TypeLinkInterface) => {
3435
(linkData.type === 'reference' && typeof linkData.target !== 'number')
3536
) {
3637
return <View as="span">{linkData.name}</View>;
38+
} else if (linkData.type === 'literal') {
39+
return <View as="span">{linkData.value}</View>;
3740
} else {
3841
return (
3942
<button className={className} onClick={onClickHandler}>

0 commit comments

Comments
 (0)