Apply suggestions from code review
Signed-off-by: Dmitry Gozman <dgozman@gmail.com>
This commit is contained in:
parent
c225c542ef
commit
af7ad7ab11
|
|
@ -22,10 +22,10 @@ import { linkifyText } from '@web/renderUtils';
|
||||||
type Annotation = { type: string; description?: string; };
|
type Annotation = { type: string; description?: string; };
|
||||||
|
|
||||||
export const AnnotationsTab: React.FunctionComponent<{
|
export const AnnotationsTab: React.FunctionComponent<{
|
||||||
annotations: Annotation[] | undefined,
|
annotations: Annotation[],
|
||||||
}> = ({ annotations }) => {
|
}> = ({ annotations }) => {
|
||||||
|
|
||||||
if (!annotations || !annotations.length)
|
if (!annotations.length)
|
||||||
return <PlaceholderPanel text='No annotations' />;
|
return <PlaceholderPanel text='No annotations' />;
|
||||||
|
|
||||||
return <div className='annotations-tab'>
|
return <div className='annotations-tab'>
|
||||||
|
|
|
||||||
|
|
@ -230,7 +230,7 @@ export const Workbench: React.FunctionComponent<{
|
||||||
const annotationsTab: TabbedPaneTabModel = {
|
const annotationsTab: TabbedPaneTabModel = {
|
||||||
id: 'annotations',
|
id: 'annotations',
|
||||||
title: 'Annotations',
|
title: 'Annotations',
|
||||||
count: annotations?.length ?? 0,
|
count: annotations.length,
|
||||||
render: () => <AnnotationsTab annotations={annotations} />
|
render: () => <AnnotationsTab annotations={annotations} />
|
||||||
};
|
};
|
||||||
tabs.push(annotationsTab);
|
tabs.push(annotationsTab);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue