Apply suggestions from code review

Signed-off-by: Dmitry Gozman <dgozman@gmail.com>
This commit is contained in:
Dmitry Gozman 2024-08-01 02:48:47 -07:00 committed by GitHub
parent c225c542ef
commit af7ad7ab11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -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'>

View file

@ -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);