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; };
|
||||
|
||||
export const AnnotationsTab: React.FunctionComponent<{
|
||||
annotations: Annotation[] | undefined,
|
||||
annotations: Annotation[],
|
||||
}> = ({ annotations }) => {
|
||||
|
||||
if (!annotations || !annotations.length)
|
||||
if (!annotations.length)
|
||||
return <PlaceholderPanel text='No annotations' />;
|
||||
|
||||
return <div className='annotations-tab'>
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ export const Workbench: React.FunctionComponent<{
|
|||
const annotationsTab: TabbedPaneTabModel = {
|
||||
id: 'annotations',
|
||||
title: 'Annotations',
|
||||
count: annotations?.length ?? 0,
|
||||
count: annotations.length,
|
||||
render: () => <AnnotationsTab annotations={annotations} />
|
||||
};
|
||||
tabs.push(annotationsTab);
|
||||
|
|
|
|||
Loading…
Reference in a new issue